/* Main Stylesheet - Scanner Sentinel */
/* Import color variables */
@import 'colors.css';

/* Global Styles */
* {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--bg-secondary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 0;
}

.main-content {
    flex: 1;
    padding-top: 0; /* No padding for login page */
}

/* Navbar Styles */
.navbar {
    background: var(--navbar-bg) !important;
    box-shadow: var(--shadow-navbar);
    padding: var(--spacing-md) var(--spacing-lg);
}

.navbar-brand {
    font-weight: var(--font-weight-bold);
    font-size: 1.4rem;
    color: var(--navbar-text) !important;
    letter-spacing: 0.3px;
}

.navbar-brand i {
    margin-right: 0.6rem;
    color: var(--accent-light);
    font-size: var(--font-icon-md);
}

.navbar .nav-link {
    color: var(--navbar-link) !important;
    font-weight: var(--font-weight-medium);
    padding: 0.6rem 1.2rem !important;
    margin: 0 var(--spacing-xs);
    transition: all var(--transition-base);
    border-radius: var(--radius-sm);
}

.navbar .nav-link:hover {
    color: var(--white) !important;
    background-color: var(--navbar-hover);
}

/* Login Page Styles */
.login-page {
    min-height: 100vh;
    min-height: -webkit-fill-available; /* Safari iOS fix */
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    padding: var(--spacing-xl) 0;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

.login-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-page-overlay);
    pointer-events: none;
}

.login-container {
    position: relative;
    z-index: 1;
}

.login-page .row.g-0 {
    align-items: center;
}

.login-card {
    background: var(--white);
    border-radius: var(--radius-xxl);
    box-shadow: var(--shadow-login-card);
    border: none;
    overflow: hidden;
    padding: var(--spacing-xxl);
    width: 100%;
    max-width: 100%;
}

/* Recovery Form */
.recovery-form {
    display: none;
}

.recovery-form.active {
    display: block;
}

.login-form.hidden {
    display: none;
}

.recovery-message {
    display: none;
    text-align: center;
    padding: 1rem 0.5rem;
}

.recovery-message.active {
    display: block;
}

.recovery-message i {
    font-size: var(--font-icon-xxl);
    color: var(--success);
    margin-bottom: var(--spacing-md);
}

.recovery-message h3 {
    color: var(--primary-blue-dark);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-xl);
    margin-bottom: 0.75rem;
}

.recovery-message p {
    color: var(--text-secondary);
    font-size: var(--font-md);
    line-height: 1.5;
    margin-bottom: var(--spacing-lg);
}

/* Reset Password Form */
.reset-password-form {
    display: none;
}

.reset-password-form.active {
    display: block;
}

.reset-user-info {
    background: var(--background-light);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.reset-user-info i {
    font-size: var(--font-icon-xl);
    color: var(--primary-blue);
}

.reset-user-info h5 {
    margin: 0;
    color: var(--text-primary);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-lg);
}

.reset-user-info p {
    margin: 0;
    color: var(--text-secondary);
    font-size: var(--font-sm);
}

.back-to-login {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: var(--font-weight-medium);
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    transition: color var(--transition-base);
}

.back-to-login:hover {
    color: var(--primary-blue-dark);
    text-decoration: underline;
}

.login-header {
    text-align: center;
    margin-bottom: 1.75rem;
}

.login-icon {
    font-size: var(--font-icon-xl);
    color: var(--primary-blue);
    margin-bottom: 0.75rem;
}

.login-header h2 {
    color: var(--primary-blue-dark);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-xxl);
    margin-bottom: 0.4rem;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: var(--font-sm);
    margin: 0;
    line-height: 1.4;
}

.login-form .form-label {
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    font-size: var(--font-sm);
    margin-bottom: var(--spacing-sm);
}

.login-form .form-control {
    padding: 0.85rem var(--spacing-md);
    font-size: var(--font-md);
    border: 2px solid var(--input-border);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    width: 100%;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.login-form .form-control:focus {
    border-color: var(--input-focus-border);
    box-shadow: var(--input-focus-shadow);
    outline: none;
}

.login-form .mb-4 {
    margin-bottom: 1.25rem !important;
}

.btn-login {
    background: var(--gradient-primary);
    border: none;
    padding: 0.85rem;
    font-size: var(--font-base);
    font-weight: var(--font-weight-semibold);
    color: var(--white);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    box-shadow: var(--shadow-button);
    margin-top: var(--spacing-xs);
    width: 100%;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.btn-login:hover {
    color: var(--white);
    transform: translateY(-3px);
    box-shadow: var(--shadow-button-hover);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login:focus {
    outline: none;
    box-shadow: var(--shadow-button-hover);
}

/* Password Toggle */
.password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: var(--font-icon-sm);
    cursor: pointer;
    padding: var(--spacing-xs);
    transition: color var(--transition-base);
}

.password-toggle:hover {
    color: var(--primary-blue);
}

.password-toggle:focus {
    outline: none;
}

/* Password Recovery */
.password-recovery {
    color: var(--primary-blue);
    text-decoration: none;
    font-size: var(--font-sm);
    font-weight: var(--font-weight-medium);
    transition: color var(--transition-base);
}

.password-recovery:hover {
    color: var(--primary-blue-dark);
    text-decoration: underline;
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-light);
}

.login-footer small {
    color: var(--text-muted);
    font-size: var(--font-xs);
}

.platforms-section {
    background: transparent;
    padding: var(--spacing-xxl) var(--spacing-xxxl);
    border-radius: 0;
}

.platforms-title {
    color: var(--white);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-xxxl);
    margin-bottom: var(--spacing-lg);
    text-align: center;
}

.platform-item {
    background: var(--platform-bg);
    padding: var(--spacing-lg);
    border-radius: var(--radius-xl);
    margin-bottom: var(--spacing-md);
    border: 1px solid var(--platform-border);
    transition: all var(--transition-base);
    display: flex;
    align-items: flex-start;
    gap: 1.15rem;
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.platform-item:last-child {
    margin-bottom: 0;
}

.platform-item:hover {
    background: var(--platform-bg-hover);
    transform: translateX(8px);
    border-color: var(--platform-border-hover);
}

.platform-icon {
    flex-shrink: 0;
}

.platform-icon i {
    color: var(--accent-light);
    font-size: var(--font-icon-lg);
}

.platform-item h5 {
    color: var(--white);
    font-weight: var(--font-weight-semibold);
    margin-bottom: 0.4rem;
    font-size: var(--font-lg);
}

.platform-item p {
    color: var(--platform-text);
    margin: 0;
    font-size: var(--font-sm);
    line-height: 1.4;
}

/* Dashboard Page - add padding back */
.main-content.dashboard-content {
    padding-top: 70px;
}

/* Footer Styles */
.footer {
    background-color: var(--footer-bg);
    border-top: 1px solid var(--border-color);
    padding: 1.25rem 0;
}

.footer-text {
    color: var(--footer-text);
    font-size: var(--font-sm);
}

.footer-link {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: var(--font-weight-semibold);
    transition: color var(--transition-base);
}

.footer-link:hover {
    color: var(--primary-blue-dark);
    text-decoration: underline;
}

#connectionStatus {
    font-size: 0.875rem;
    padding: 0.4rem 0.8rem;
}

#connectionStatus.connected {
    background-color: var(--success) !important;
}

#connectionStatus.disconnected {
    background-color: var(--gray-500) !important;
}

/* Card Styles */
.card {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    margin-bottom: var(--spacing-lg);
    border: 1px solid var(--border-light);
}

.card-header {
    background-color: var(--white);
    border-bottom: 2px solid var(--primary-blue);
    font-weight: var(--font-weight-semibold);
    padding: var(--spacing-md) 1.25rem;
}

/* Alert Styles */
.alert {
    border-radius: var(--radius-md);
}

/* Table Styles */
.table-hover tbody tr:hover {
    background-color: var(--table-hover-bg);
    cursor: pointer;
}

/* Badge Styles */
.badge {
    padding: 0.35em 0.65em;
    font-weight: var(--font-weight-medium);
}

/* Loading Spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15rem;
}

/* Responsive Adjustments */

/* Mobile First - Base styles for small devices (320px+) */
@media (max-width: 575.98px) {
    .login-page {
        padding: var(--spacing-md) 0;
    }

    .login-card {
        padding: var(--spacing-xl) var(--spacing-md);
        border-radius: var(--radius-lg);
    }

    .login-icon {
        font-size: 2rem;
        margin-bottom: var(--spacing-sm);
    }

    .login-header h2 {
        font-size: 1.4rem;
    }

    .login-subtitle {
        font-size: 0.85rem;
    }

    .login-form .form-label {
        font-size: 0.85rem;
    }

    .login-form .form-control {
        padding: 0.75rem 0.85rem;
        font-size: 0.9rem;
    }

    .btn-login {
        padding: 0.75rem;
        font-size: 0.95rem;
    }

    .platforms-section {
        padding: var(--spacing-lg) var(--spacing-md);
        margin-top: var(--spacing-md);
    }

    .platforms-title {
        font-size: 1.5rem;
        margin-bottom: var(--spacing-md);
    }

    .platform-item {
        padding: var(--spacing-md);
        gap: 0.85rem;
        margin-bottom: 0.75rem;
        flex-direction: column;
        text-align: center;
        align-items: center;
    }

    .platform-icon i {
        font-size: 1.75rem;
    }

    .platform-item h5 {
        font-size: 1rem;
    }

    .platform-item p {
        font-size: 0.85rem;
    }

    .navbar {
        padding: 0.75rem var(--spacing-md);
    }

    .navbar-brand {
        font-size: 1.1rem;
    }

    .navbar-brand i {
        font-size: 1.25rem;
    }

    .navbar .nav-link {
        padding: var(--spacing-sm) var(--spacing-md) !important;
        font-size: 0.9rem;
    }

    .footer-text {
        font-size: 0.8rem;
    }

    .recovery-message {
        padding: 0.75rem 0.25rem;
    }

    .recovery-message i {
        font-size: 2.5rem;
    }

    .recovery-message h3 {
        font-size: 1.25rem;
    }

    .recovery-message p {
        font-size: 0.85rem;
    }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .login-card {
        padding: var(--spacing-xl) var(--spacing-lg);
    }

    .platforms-section {
        padding: var(--spacing-xl) var(--spacing-lg);
    }

    .platform-item {
        flex-direction: row;
        text-align: left;
        align-items: flex-start;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .main-content.dashboard-content {
        padding-top: 60px;
    }

    .login-card {
        padding: var(--spacing-xxl) var(--spacing-xl);
    }

    .platforms-section {
        padding: var(--spacing-xl) var(--spacing-lg);
        margin-top: 0;
    }

    .platforms-title {
        font-size: var(--font-xxl);
    }

    .platform-item {
        padding: 1.25rem;
        gap: var(--spacing-md);
    }

    .navbar-brand {
        font-size: 1.2rem;
    }

    .login-header h2 {
        font-size: 1.6rem;
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .login-card {
        padding: var(--spacing-xxl);
    }

    .platforms-section {
        padding: var(--spacing-xxl) var(--spacing-xl);
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .login-card {
        padding: var(--spacing-xxl);
    }

    .platforms-section {
        padding: var(--spacing-xxl) var(--spacing-xxxl);
    }

    .container {
        max-width: 1140px;
    }
}

/* Browser-specific fixes */

/* Safari specific */
@supports (-webkit-appearance: none) and (not (overflow: -webkit-marquee)) and (not (-ms-ime-align: auto)) {
    .login-card {
        -webkit-backface-visibility: hidden;
        -webkit-transform: translateZ(0);
    }

    .btn-login {
        -webkit-appearance: none;
    }

    input[type="text"],
    input[type="password"],
    input[type="email"] {
        -webkit-appearance: none;
        -webkit-border-radius: var(--radius-md);
    }
}

/* Firefox specific */
@-moz-document url-prefix() {
    .login-card {
        scrollbar-width: thin;
        scrollbar-color: var(--primary-blue-light) var(--gray-200);
    }

    input[type="text"],
    input[type="password"],
    input[type="email"] {
        -moz-appearance: none;
    }
}

/* Landscape orientation for mobile devices */
@media (max-width: 767.98px) and (orientation: landscape) {
    .login-page {
        padding: var(--spacing-sm) 0;
    }

    .login-card {
        padding: var(--spacing-lg) var(--spacing-md);
    }

    .login-header {
        margin-bottom: var(--spacing-md);
    }

    .login-icon {
        font-size: 1.75rem;
        margin-bottom: var(--spacing-xs);
    }

    .login-header h2 {
        font-size: 1.3rem;
    }

    .platforms-section {
        padding: var(--spacing-md);
    }

    .platforms-title {
        font-size: 1.4rem;
        margin-bottom: var(--spacing-sm);
    }

    .platform-item {
        padding: 0.85rem;
        margin-bottom: var(--spacing-sm);
    }
}

/* High DPI screens (Retina displays) */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .login-icon,
    .platform-icon i {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Toast notification styles */
#copyToast {
    animation: slideDown 0.3s ease-out;
}

#copyToast.fade-out {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideDown {
    from {
        transform: translate(-50%, -100%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translate(-50%, 0);
        opacity: 1;
    }
    to {
        transform: translate(-50%, -100%);
        opacity: 0;
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .btn-login:hover,
    .platform-item:hover {
        transform: none !important;
    }
}
