/**
 * FZ Zulassung Checker - Public Styles
 *
 * Apple-inspired, minimalist design with clean typography
 * and smooth interactions.
 *
 * @package FZ_Zulassung_Checker
 * @since   1.0.0
 */

/* ==========================================================================
   CSS Variables
   ========================================================================== */

:root {
    --fz-primary: #718EB6;
    --fz-primary-dark: #5a7498;
    --fz-primary-light: #8fa4c4;
    --fz-primary-subtle: rgba(113, 142, 182, 0.1);
    --fz-success: #34c759;
    --fz-error: #ff3b30;
    --fz-warning: #ff9500;
    --fz-bg: #f5f5f7;
    --fz-card-bg: #ffffff;
    --fz-text: #1d1d1f;
    --fz-text-secondary: #6e6e73;
    --fz-text-tertiary: #86868b;
    --fz-border: #d2d2d7;
    --fz-border-light: #e8e8ed;
    --fz-radius: 12px;
    --fz-radius-lg: 18px;
    --fz-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    --fz-shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.12);
    --fz-transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
    --fz-font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* ==========================================================================
   Base Container
   ========================================================================== */

.fz-checker-wrapper {
    font-family: var(--fz-font);
    color: var(--fz-text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    max-width: 680px;
    margin: 0 auto;
    padding: 20px;
}

.fz-checker-container {
    background: var(--fz-card-bg);
    border-radius: var(--fz-radius-lg);
    box-shadow: var(--fz-shadow);
    padding: 40px;
    border: 1px solid var(--fz-border-light);
}

/* ==========================================================================
   Title
   ========================================================================== */

.fz-checker-title {
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.5px;
    color: var(--fz-text);
    margin: 0 0 28px 0;
    text-align: center;
}

/* ==========================================================================
   Mode Selector (Tab Navigation)
   ========================================================================== */

.fz-mode-selector {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--fz-bg);
    border-radius: var(--fz-radius);
    margin-bottom: 32px;
}

.fz-mode-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    font-size: 14px;
    font-weight: 500;
    font-family: var(--fz-font);
    color: var(--fz-text-secondary);
    background: transparent;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--fz-transition);
}

.fz-mode-tab:hover:not(.fz-mode-tab-active) {
    color: var(--fz-text);
    background: rgba(255, 255, 255, 0.5);
}

.fz-mode-tab-active {
    color: var(--fz-text);
    background: var(--fz-card-bg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.fz-mode-tab svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ==========================================================================
   Panels
   ========================================================================== */

.fz-panel {
    display: none;
    animation: fz-panel-in 0.3s ease-out;
}

.fz-panel-active,
.fz-panel:not([hidden]) {
    display: block;
}

@keyframes fz-panel-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Form Elements
   ========================================================================== */

.fz-checker-form {
    max-width: 100%;
}

.fz-form-group {
    margin-bottom: 24px;
}

.fz-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--fz-text-secondary);
    margin-bottom: 10px;
    letter-spacing: 0.3px;
}

.fz-input-wrapper {
    position: relative;
}

.fz-input {
    width: 100%;
    padding: 16px 50px 16px 20px;
    font-size: 20px;
    font-weight: 500;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    letter-spacing: 2px;
    color: var(--fz-text);
    background: var(--fz-bg);
    border: 2px solid transparent;
    border-radius: var(--fz-radius);
    outline: none;
    transition: var(--fz-transition);
    box-sizing: border-box;
}

.fz-input::placeholder {
    color: var(--fz-text-tertiary);
    letter-spacing: 2px;
}

.fz-input:focus {
    background: var(--fz-card-bg);
    border-color: var(--fz-primary);
    box-shadow: 0 0 0 4px var(--fz-primary-subtle);
}

.fz-input:invalid:not(:placeholder-shown) {
    border-color: var(--fz-error);
}

.fz-input-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--fz-text-tertiary);
    pointer-events: none;
}

.fz-input-icon svg {
    width: 22px;
    height: 22px;
}

.fz-validation-message {
    display: block;
    font-size: 13px;
    color: var(--fz-error);
    margin-top: 8px;
    min-height: 20px;
}

.fz-input-hint {
    font-size: 12px;
    color: var(--fz-text-tertiary);
    margin-top: 8px;
}

/* ==========================================================================
   Submit Button
   ========================================================================== */

.fz-submit-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 18px 32px;
    font-size: 17px;
    font-weight: 600;
    font-family: var(--fz-font);
    color: #ffffff;
    background: linear-gradient(180deg, var(--fz-primary) 0%, var(--fz-primary-dark) 100%);
    border: none;
    border-radius: var(--fz-radius);
    cursor: pointer;
    transition: var(--fz-transition);
    box-shadow: 0 4px 12px rgba(113, 142, 182, 0.35);
}

.fz-submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(113, 142, 182, 0.45);
}

.fz-submit-button:active {
    transform: translateY(0);
}

.fz-submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.fz-button-loading {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ==========================================================================
   Spinner Animation
   ========================================================================== */

.fz-spinner {
    width: 20px;
    height: 20px;
    animation: fz-rotate 1.4s linear infinite;
}

.fz-spinner-path {
    stroke: currentColor;
    stroke-linecap: round;
    animation: fz-dash 1.4s ease-in-out infinite;
}

@keyframes fz-rotate {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes fz-dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }
    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

/* ==========================================================================
   Error Container
   ========================================================================== */

.fz-error-container {
    margin-top: 24px;
}

.fz-error-message {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: rgba(255, 59, 48, 0.1);
    border-radius: var(--fz-radius);
    color: var(--fz-error);
    font-weight: 500;
}

.fz-error-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

/* ==========================================================================
   Result Container
   ========================================================================== */

.fz-result-container {
    margin-top: 32px;
    animation: fz-fade-in 0.4s ease-out;
}

@keyframes fz-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Result Card
   ========================================================================== */

.fz-result-card {
    background: var(--fz-card-bg);
    border-radius: var(--fz-radius-lg);
    border: 1px solid var(--fz-border-light);
    overflow: hidden;
}

.fz-result-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px;
    background: linear-gradient(180deg, rgba(52, 199, 89, 0.1) 0%, rgba(52, 199, 89, 0.05) 100%);
    border-bottom: 1px solid var(--fz-border-light);
}

.fz-result-success-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--fz-success);
    border-radius: 50%;
    flex-shrink: 0;
}

.fz-result-success-icon svg {
    width: 28px;
    height: 28px;
    color: #fff;
}

.fz-result-header-text {
    flex: 1;
}

.fz-result-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--fz-text);
    margin: 0 0 4px 0;
}

.fz-result-stammnummer {
    font-size: 14px;
    color: var(--fz-text-secondary);
    margin: 0;
}

.fz-result-stammnummer strong {
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    color: var(--fz-text);
    letter-spacing: 1px;
}

/* ==========================================================================
   Result Body
   ========================================================================== */

.fz-result-body {
    padding: 0;
}

/* ==========================================================================
   Result Sections
   ========================================================================== */

.fz-result-section {
    padding: 24px;
    border-bottom: 1px solid var(--fz-border-light);
}

.fz-result-section:last-child {
    border-bottom: none;
}

.fz-result-section-highlight {
    background: linear-gradient(180deg, var(--fz-primary-subtle) 0%, rgba(113, 142, 182, 0.02) 100%);
}

.fz-result-section-meta {
    background: var(--fz-bg);
}

.fz-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--fz-text-secondary);
    margin: 0 0 20px 0;
}

.fz-section-title svg {
    width: 18px;
    height: 18px;
    color: var(--fz-primary);
}

/* ==========================================================================
   Data Grid
   ========================================================================== */

.fz-data-grid {
    display: grid;
    gap: 20px;
}

.fz-data-grid-2col {
    grid-template-columns: repeat(2, 1fr);
}

.fz-data-grid-3col {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 600px) {
    .fz-data-grid-2col,
    .fz-data-grid-3col {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Data Items
   ========================================================================== */

.fz-data-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.fz-data-item-featured {
    padding: 16px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: var(--fz-radius);
    border: 1px solid var(--fz-border-light);
}

.fz-data-label {
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--fz-text-tertiary);
}

.fz-data-value {
    font-size: 16px;
    font-weight: 500;
    color: var(--fz-text);
}

.fz-data-value-large {
    font-size: 24px;
    font-weight: 600;
    color: var(--fz-primary-dark);
}

.fz-data-code {
    font-size: 12px;
    color: var(--fz-text-tertiary);
    font-weight: 400;
}

/* ==========================================================================
   Result Footer
   ========================================================================== */

.fz-result-footer {
    display: flex;
    justify-content: center;
    padding: 20px 24px;
    background: var(--fz-bg);
    border-top: 1px solid var(--fz-border-light);
}

.fz-new-search-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 500;
    font-family: var(--fz-font);
    color: #ffffff;
    background: var(--fz-primary);
    border: 2px solid var(--fz-primary);
    border-radius: var(--fz-radius);
    cursor: pointer;
    transition: var(--fz-transition);
}

.fz-new-search-button:hover {
    background: transparent;
    color: var(--fz-primary);
}

.fz-new-search-button svg {
    width: 18px;
    height: 18px;
}

/* ==========================================================================
   Source Info
   ========================================================================== */

.fz-source-info {
    text-align: center;
    font-size: 12px;
    color: var(--fz-text-tertiary);
    margin: 20px 0 0 0;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 480px) {
    .fz-checker-container {
        padding: 24px;
        border-radius: var(--fz-radius);
    }

    .fz-checker-title {
        font-size: 24px;
        margin-bottom: 24px;
    }

    .fz-input {
        font-size: 18px;
        padding: 14px 45px 14px 16px;
    }

    .fz-submit-button {
        padding: 16px 24px;
        font-size: 16px;
    }

    .fz-result-header {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }

    .fz-result-section {
        padding: 20px;
    }

    .fz-data-value-large {
        font-size: 20px;
    }
}

/* ==========================================================================
   Dark Mode Support (Optional)
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    .fz-checker-wrapper {
        /* Uncomment to enable dark mode */
        /* --fz-bg: #1c1c1e;
        --fz-card-bg: #2c2c2e;
        --fz-text: #f5f5f7;
        --fz-text-secondary: #a1a1a6;
        --fz-text-tertiary: #8e8e93;
        --fz-border: #48484a;
        --fz-border-light: #3a3a3c; */
    }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

.fz-input:focus-visible,
.fz-submit-button:focus-visible,
.fz-new-search-button:focus-visible {
    outline: 2px solid var(--fz-primary);
    outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==========================================================================
   Bulk Upload Styles
   ========================================================================== */

.fz-bulk-intro {
    margin-bottom: 20px;
    text-align: center;
}

.fz-bulk-intro p {
    font-size: 14px;
    color: var(--fz-text-secondary);
    margin: 0;
}

/* Bulk Features */
.fz-bulk-features {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--fz-bg);
    border-radius: var(--fz-radius);
}

.fz-feature {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--fz-text-secondary);
}

.fz-feature svg {
    color: var(--fz-primary);
    flex-shrink: 0;
}

/* Bulk Actions */
.fz-bulk-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 20px;
}

.fz-link-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    font-family: var(--fz-font);
    color: var(--fz-primary);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: var(--fz-transition);
    border-radius: 8px;
}

.fz-link-button:hover {
    background: var(--fz-primary-subtle);
}

.fz-link-button svg {
    flex-shrink: 0;
}

.fz-bulk-submit {
    flex: 1;
    max-width: 280px;
}

/* Dropzone */
.fz-bulk-dropzone {
    position: relative;
    border: 2px dashed var(--fz-border);
    border-radius: var(--fz-radius);
    background: var(--fz-bg);
    transition: var(--fz-transition);
    overflow: hidden;
}

.fz-bulk-dropzone:hover,
.fz-bulk-dropzone.fz-dragover {
    border-color: var(--fz-primary);
    background: var(--fz-primary-subtle);
}

.fz-bulk-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.fz-dropzone-content {
    padding: 32px 24px;
    text-align: center;
}

.fz-dropzone-icon-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    background: var(--fz-primary-subtle);
    border-radius: 50%;
    margin-bottom: 16px;
}

.fz-dropzone-icon {
    color: var(--fz-primary);
    width: 32px;
    height: 32px;
}

.fz-dropzone-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--fz-text);
    margin: 0 0 4px 0;
}

.fz-dropzone-hint {
    font-size: 13px;
    color: var(--fz-text-tertiary);
    margin: 0;
}

/* Selected File State */
.fz-dropzone-selected {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: var(--fz-primary-subtle);
}

.fz-file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.fz-file-info svg {
    color: var(--fz-primary);
    flex-shrink: 0;
}

.fz-selected-filename {
    font-size: 14px;
    font-weight: 500;
    color: var(--fz-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fz-remove-file {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: var(--fz-text-tertiary);
    transition: var(--fz-transition);
    z-index: 3;
    position: relative;
    flex-shrink: 0;
}

.fz-remove-file:hover {
    background: rgba(255, 59, 48, 0.1);
    color: var(--fz-error);
}

/* Bulk Submit Button */
.fz-bulk-submit {
    margin-top: 20px;
}

/* Bulk Result Container */
.fz-bulk-result-container {
    margin-top: 32px;
    animation: fz-fade-in 0.4s ease-out;
}

.fz-bulk-result-card {
    background: var(--fz-card-bg);
    border-radius: var(--fz-radius-lg);
    border: 1px solid var(--fz-border-light);
    overflow: hidden;
}

.fz-bulk-result-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px;
    background: linear-gradient(180deg, rgba(52, 199, 89, 0.1) 0%, rgba(52, 199, 89, 0.05) 100%);
    border-bottom: 1px solid var(--fz-border-light);
}

.fz-bulk-result-message {
    font-size: 14px;
    color: var(--fz-text-secondary);
    margin: 0;
}

/* Bulk Stats */
.fz-bulk-result-body {
    padding: 24px;
}

.fz-bulk-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.fz-bulk-stat {
    text-align: center;
    padding: 16px;
    background: var(--fz-bg);
    border-radius: var(--fz-radius);
}

.fz-stat-value {
    display: block;
    font-size: 28px;
    font-weight: 600;
    color: var(--fz-text);
    margin-bottom: 4px;
}

.fz-stat-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--fz-text-tertiary);
}

.fz-stat-total .fz-stat-value {
    color: var(--fz-primary-dark);
}

.fz-stat-found .fz-stat-value {
    color: var(--fz-success);
}

.fz-stat-not-found .fz-stat-value {
    color: var(--fz-warning);
}

.fz-stat-invalid .fz-stat-value {
    color: var(--fz-error);
}

/* Bulk Result Footer */
.fz-bulk-result-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    padding: 20px 24px;
    background: var(--fz-bg);
    border-top: 1px solid var(--fz-border-light);
}

.fz-download-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    font-family: var(--fz-font);
    color: #ffffff;
    background: var(--fz-success);
    border: 2px solid var(--fz-success);
    border-radius: var(--fz-radius);
    cursor: pointer;
    transition: var(--fz-transition);
}

.fz-download-button:hover {
    background: transparent;
    color: var(--fz-success);
}

.fz-download-button svg {
    flex-shrink: 0;
}

/* Responsive Adjustments */
@media (max-width: 600px) {
    .fz-checker-container {
        padding: 28px 20px;
    }

    .fz-checker-title {
        font-size: 24px;
        margin-bottom: 24px;
    }

    .fz-mode-selector {
        margin-bottom: 24px;
    }

    .fz-mode-tab {
        padding: 12px 16px;
        font-size: 13px;
        gap: 6px;
    }

    .fz-mode-tab svg {
        width: 16px;
        height: 16px;
    }

    .fz-bulk-features {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .fz-bulk-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .fz-bulk-submit {
        max-width: 100%;
    }

    .fz-link-button {
        justify-content: center;
    }

    .fz-bulk-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .fz-bulk-result-footer {
        flex-direction: column;
    }

    .fz-bulk-result-footer button {
        width: 100%;
        justify-content: center;
    }

    .fz-bulk-info-list {
        flex-direction: column;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .fz-dropzone-content {
        padding: 32px 16px;
    }

    .fz-stat-value {
        font-size: 24px;
    }

    .fz-bulk-result-header {
        flex-direction: column;
        text-align: center;
    }
}
