/* Main Application Styles - Dark Only */

/* Reset and remove default margins/padding */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
}

/* Main layout structure */
.identity-layout {
    min-height: 100vh;
    width: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.identity-content {
    flex: 1;
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Remove AntDesign Layout default styles */
.ant-layout {
    background: transparent !important;
    min-height: 100vh;
}

.ant-layout-content {
    background: transparent !important;
}

/* Header Styles */
.identity-header {
    background: #141414;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid #262626;
}

.identity-header-content {
    display: flex;
    align-items: center;
    height: 64px;
    padding: 0 24px;
}

.identity-header-spacer {
    flex: 1;
}

.identity-header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.identity-header-logo {
    color: #facc15 !important;
    font-size: 24px;
}

.identity-header-title {
    color: #fff !important;
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.identity-header-actions {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

/* Language Switcher Dropdown */
.language-switcher {
    position: relative;
}

.language-switcher-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.85);
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    height: 32px;
    transition: all 0.2s;
    outline: none;
}

.language-switcher-trigger:hover {
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
}

.language-switcher-trigger:focus-visible {
    outline: 2px solid #facc15;
    outline-offset: 2px;
}

.language-switcher-trigger .globe-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.language-switcher-trigger .current-flag {
    font-size: 16px;
    line-height: 1;
}

.language-switcher-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: #1f1f1f;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
    min-width: 160px;
    padding: 4px;
    z-index: 1050;
    display: none;
    opacity: 0;
    transform: translateY(-4px);
}

.language-switcher-dropdown.open {
    display: block;
    animation: dropdownFadeIn 0.15s ease-out forwards;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.language-switcher-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
}

.language-switcher-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.language-switcher-item.active {
    background: rgba(250, 204, 21, 0.15);
    color: #facc15;
}

.language-switcher-item .item-flag {
    font-size: 18px;
    line-height: 1;
}

.language-switcher-item .item-label {
    flex: 1;
}

/* Page centering for forms */
.ant-page {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: #0a0a0a;
    margin: 0;
}

/* Card adjustments for better centering */
.ant-card {
    margin: 0 auto;
}

/* Form validation styles */
.ant-form-item-required::before {
    content: '*';
    color: #ff4d4f;
    margin-right: 4px;
}

.ant-form-item-explain-error {
    color: #ff4d4f;
    font-size: 14px;
    line-height: 1.5715;
    margin-top: 4px;
    min-height: 24px;
}

/* Success state */
.ant-form-item-has-success .ant-input {
    border-color: #52c41a;
}

.ant-form-item-has-success .ant-input:focus {
    border-color: #52c41a;
    box-shadow: 0 0 0 2px rgba(82, 196, 26, 0.1);
}

/* Error state */
.ant-form-item-has-error .ant-input {
    border-color: #ff4d4f;
    box-shadow: 0 0 0 2px rgba(255, 77, 79, 0.1);
}

.ant-form-item-has-error .ant-input:focus,
.ant-form-item-has-error .ant-input:hover {
    border-color: #ff4d4f;
}

/* Content wrapper */
.simple-content {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

/* Footer styles */
.identity-footer {
    text-align: center;
    padding: 24px;
    background: #141414;
    border-top: 1px solid #262626;
}

.identity-footer p {
    margin: 0 0 8px 0;
    color: rgba(255, 255, 255, 0.45);
}

.identity-footer a {
    color: rgba(255, 255, 255, 0.65);
    transition: color 0.3s;
}

.identity-footer a:hover {
    color: #facc15;
}

/* Loading spinner */
.ant-btn-loading-icon {
    display: inline-block;
    margin-right: 8px;
}

@keyframes antRotate {
    to {
        transform: rotate(360deg);
    }
}

.anticon-spin {
    animation: antRotate 1s linear infinite;
}

/* Utility classes */
.text-center {
    text-align: center;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mt-3 {
    margin-top: 1rem;
}

/* Skeleton Loader */
.skeleton {
    background: linear-gradient(90deg, #262626 25%, #404040 50%, #262626 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
    width: 100%;
}

.skeleton-input {
    height: 40px;
    margin-bottom: 16px;
    width: 100%;
}

.skeleton-button {
    height: 40px;
    width: 100%;
}

/* Loading State */
.loading-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
    max-width: 480px;
    margin: 0 auto;
}

/* Mobile Responsive Improvements */
@media (max-width: 768px) {
    .ant-page {
        padding: 16px;
    }

    .ant-card {
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    }

    .ant-card-body {
        padding: 20px;
    }

    .ant-btn {
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    .ant-input {
        font-size: 16px; /* Prevents zoom on iOS */
        touch-action: manipulation;
    }

    .identity-header {
        position: sticky;
        top: 0;
        z-index: 1000;
    }
}

/* Accessibility Improvements */
.ant-btn:focus-visible,
.ant-input:focus-visible,
a:focus-visible {
    outline: 2px solid #facc15;
    outline-offset: 2px;
}

/* Skip to main content link */
.skip-to-main {
    position: absolute;
    left: -9999px;
    z-index: 999;
    padding: 1em;
    background-color: #141414;
    color: white;
    text-decoration: none;
}

.skip-to-main:focus {
    left: 50%;
    transform: translateX(-50%);
    top: 0;
}

/* Error State Improvements */
.error-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.error-card {
    background: #1f1f1f;
    padding: 32px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    max-width: 500px;
    width: 100%;
}

.error-icon {
    font-size: 48px;
    color: #ff4d4f;
    text-align: center;
    margin-bottom: 16px;
}

.error-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    flex-wrap: wrap;
}

/* Touch-friendly form elements */
.ant-form-item {
    margin-bottom: 20px;
}

.ant-input,
.ant-btn {
    min-height: 44px; /* Touch-friendly size */
}

/* Progressive Enhancement */
.no-js .requires-js {
    display: none;
}

.no-js .fallback-content {
    display: block;
}

/* Print Styles */
@media print {
    .identity-header,
    .identity-footer,
    .ant-btn,
    .no-print {
        display: none !important;
    }

    .ant-card {
        box-shadow: none;
        border: 1px solid #434343;
    }
}

/* Override for dark header background */
.ant-layout-header {
    background: #141414 !important;
}

/* Ensure Livepasses title is visible */
.ant-typography {
    color: inherit;
}
