/**
 * AZZRK Helper - Main CSS Styles
 * Modern, clean design inspired by DGA Saudi with blue/cyan theme
 */

:root {
    /* Primary Colors - From Logo */
    --primary: #0095D9;
    --primary-dark: #0077B5;
    --primary-light: #00B4E6;
    --accent: #00D4AA;
    --accent-dark: #00B894;

    /* Neutral Colors */
    --bg-primary: #F8FAFC;
    --bg-secondary: #FFFFFF;
    --bg-glass: rgba(255, 255, 255, 0.7);
    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --text-muted: #94A3B8;
    --border: #E2E8F0;
    --border-light: #F1F5F9;

    /* Status Colors */
    --success: #10B981;
    --warning: #F59E0B;
    --error: #EF4444;
    --info: #3B82F6;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 20px rgba(0, 149, 217, 0.3);

    /* Layout */
    --header-height: 80px;
    --sidebar-width: 280px;
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --border-radius-xl: 20px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Fonts */
    --font-family: 'IBM Plex Sans Arabic', sans-serif;
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loader {
    text-align: center;
    color: white;
}

.loader i {
    font-size: 60px;
    margin-bottom: 20px;
    animation: pulse 1.5s ease-in-out infinite;
}

.loader p {
    font-size: 18px;
    font-weight: 600;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* Auth Screen */
.auth-screen {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-container {
    background: var(--bg-secondary);
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo {
    width: 80px;
    height: 80px;
    margin-bottom: 15px;
}

.auth-header h1 {
    color: var(--primary);
    font-size: 24px;
    margin-bottom: 5px;
}

.auth-header h1 i {
    margin-left: 8px;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.auth-form h2 {
    color: var(--text-primary);
    font-size: 20px;
    margin-bottom: 25px;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.form-group label i {
    margin-left: 6px;
    color: var(--primary);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--border-radius);
    font-size: 15px;
    font-family: var(--font-family);
    transition: var(--transition-fast);
    background: var(--bg-primary);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 149, 217, 0.1);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.btn-primary {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 700;
    font-family: var(--font-family);
    cursor: pointer;
    transition: var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(0);
}

.error-message {
    background: #FEE2E2;
    color: var(--error);
    padding: 12px;
    border-radius: var(--border-radius);
    margin-bottom: 15px;
    font-size: 14px;
    text-align: center;
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

.auth-switch a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* Dashboard */
.dashboard {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Top Header */
.top-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1000;
    transition: var(--transition-normal);
}

.header-right,
.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Clock */
.clock-wrapper {
    text-align: center;
}

.digital-clock {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 1px;
}

.clock-date {
    font-size: 12px;
    color: var(--text-secondary);
}

.work-status {
    font-size: 13px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    background: var(--bg-primary);
}

.work-status.work {
    color: var(--success);
}

.work-status.break {
    color: var(--warning);
}

.work-status.off {
    color: var(--error);
}

/* Search */
.header-center {
    flex: 1;
    max-width: 600px;
    margin: 0 24px;
}

.search-container {
    width: 100%;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 30px;
    padding: 0 16px;
    transition: var(--transition-fast);
}

.search-box:focus-within {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.search-icon {
    color: var(--text-muted);
    font-size: 16px;
}

.search-box input {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: transparent;
    font-family: var(--font-family);
    font-size: 15px;
    color: var(--text-primary);
}

.search-box input:focus {
    outline: none;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-actions {
    display: flex;
    gap: 8px;
}

.search-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--bg-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.search-btn:hover {
    transform: scale(1.1);
}

.search-btn img {
    width: 24px;
    height: 24px;
}

.search-options {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 8px;
    justify-content: center;
}

.search-option {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.search-option input[type="checkbox"] {
    accent-color: var(--primary);
}

.flag-icon {
    border-radius: 3px;
}

/* Header Buttons */
.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--bg-primary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    font-size: 16px;
}

.icon-btn:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
}

/* User Menu */
.user-menu {
    position: relative;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    background: var(--bg-primary);
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.user-btn:hover {
    background: var(--border);
}

.user-btn img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.user-btn span {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.user-btn i {
    color: var(--text-muted);
    font-size: 12px;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    padding: 8px 0;
    z-index: 1001;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.dropdown-header span {
    display: block;
}

.dropdown-header .email {
    font-size: 12px;
    color: var(--text-muted);
}

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition-fast);
}

.user-dropdown a:hover {
    background: var(--bg-primary);
}

.user-dropdown a i {
    width: 16px;
    color: var(--text-muted);
}

.user-dropdown a.logout {
    color: var(--error);
}

.user-dropdown a.logout i {
    color: var(--error);
}

.user-dropdown hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 8px 0;
}

/* Main Content */
.main-content {
    margin-top: var(--header-height);
    padding: 24px;
    min-height: calc(100vh - var(--header-height) - 60px);
}

.shortcuts-container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Category Section */
.category-section {
    margin-bottom: 32px;
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.category-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
}

.category-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.category-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.category-title-ar {
    font-size: 14px;
    color: var(--text-secondary);
    margin-right: 8px;
}

/* Shortcuts Grid */
.shortcuts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 16px;
}

/* Shortcut Card */
.shortcut-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: 16px;
    text-align: center;
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition-normal);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.shortcut-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
    transform: scaleX(0);
    transition: var(--transition-normal);
}

.shortcut-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.shortcut-card:hover::before {
    transform: scaleX(1);
}

.shortcut-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 22px;
    transition: var(--transition-normal);
}

.shortcut-card:hover .shortcut-icon {
    transform: scale(1.1);
    border-color: var(--primary);
}

.shortcut-icon img {
    width: 28px;
    height: 28px;
}

.shortcut-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    word-break: break-word;
}

/* Custom shortcut badge */
.shortcut-card.custom::after {
    content: '✨';
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 12px;
}

/* Footer */
.footer {
    padding: 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.modal-container {
    background: var(--bg-secondary);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 18px;
    color: var(--text-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--bg-primary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.modal-close:hover {
    background: var(--error);
    color: white;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.btn-secondary {
    padding: 10px 20px;
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    font-family: var(--font-family);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-secondary:hover {
    background: var(--border);
}

/* Responsive */
@media (max-width: 768px) {
    .top-header {
        flex-wrap: wrap;
        height: auto;
        padding: 12px;
        gap: 12px;
    }

    .header-right,
    .header-left {
        order: 1;
    }

    .header-center {
        order: 2;
        width: 100%;
        max-width: none;
        margin: 12px 0 0 0;
    }

    .clock-wrapper {
        display: none;
    }

    .main-content {
        margin-top: 140px;
        padding: 16px;
    }

    .shortcuts-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 12px;
    }

    .shortcut-card {
        padding: 12px;
    }

    .shortcut-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .shortcut-title {
        font-size: 11px;
    }

    .search-options {
        flex-wrap: wrap;
    }
}