@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    /* Sophisticated Theme */
    --bg-color: #f4f9f5;
    --card-bg: rgba(255, 255, 255, 0.92);
    --border-color: rgba(17, 87, 64, 0.15);
    
    /* Typography */
    --text-primary: #022c22;
    --text-secondary: #064e3b;
    --text-tertiary: #047857;
    
    /* Branding */
    --pakistan-green: #115740;
    --pakistan-green-light: #10b981;
    --pakistan-green-dark: #083c2a;
    
    /* Actions */
    --accent: var(--pakistan-green);
    --accent-hover: var(--pakistan-green-dark);
    --success: #059669;
    --success-hover: #047857;
    --success-bg: #d1fae5;
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --danger-bg: #fee2e2;

    /* Geometry */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    
    /* Shadows */
    --shadow-soft: 0 4px 20px -2px rgba(15, 23, 42, 0.05);
    --shadow-hover: 0 12px 35px -5px rgba(15, 23, 42, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    overflow-wrap: break-word;
}

html {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    max-width: 100%;
    overflow-x: hidden;
    width: 100%;
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    position: relative;
    padding: 2rem 1rem;
    line-height: 1.5;
}

/* Background animated shapes for depth */
.background-shapes {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
    overflow: hidden;
    background: radial-gradient(circle at top right, #e6f4ea, #f4f9f5);
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.6;
    animation: float 12s infinite alternate ease-in-out;
}

.shape-1 {
    width: 50vw;
    height: 50vw;
    background: rgba(16, 185, 129, 0.4);
    top: -10vw;
    left: -10vw;
}

.shape-2 {
    width: 60vw;
    height: 60vw;
    background: rgba(17, 87, 64, 0.3);
    bottom: -15vw;
    right: -10vw;
    animation-delay: -5s;
}

.shape-3 {
    width: 40vw;
    height: 40vw;
    background: rgba(16, 185, 129, 0.2);
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -2s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, 20px) scale(1.05); }
}

.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    z-index: 1;
}

/* Professional Glassmorphism card */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-soft);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
    box-shadow: var(--shadow-hover);
}

/* Login specific */
.login-card {
    max-width: 420px;
    margin: 8vh auto;
    padding: 3rem 2.5rem;
}

.title {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-align: center;
    color: var(--pakistan-green-dark);
    letter-spacing: -0.02em;
}

.subtitle {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 2.5rem;
    font-weight: 400;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.input-group input {
    width: 100%;
    padding: 0.85rem 1.25rem;
    background: rgba(255,255,255,0.7);
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(6, 95, 70, 0.1);
    background: #ffffff;
}

button {
    width: 100%;
    padding: 0.85rem 1.25rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 12px rgba(6, 95, 70, 0.2);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(6, 95, 70, 0.3);
}

.btn-success {
    background: var(--success);
    color: white;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.2);
}

.btn-success:hover:not([disabled]) {
    background: var(--success-hover);
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--danger);
    color: white;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}

.btn-danger:hover:not([disabled]) {
    background: var(--danger-hover);
    transform: translateY(-1px);
}

button[disabled] {
    background: #cbd5e1 !important;
    color: #64748b !important;
    box-shadow: none !important;
    cursor: not-allowed;
    transform: none !important;
}

.btn-logout {
    padding: 0.5rem 1rem;
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: inline-block;
}

.btn-logout:hover {
    background: var(--danger);
    color: white;
}

/* Dashboard Layout */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.25rem 2rem;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

.dashboard-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.5rem;
}

.profile-card {
    grid-column: span 5;
}

.attendance-card {
    grid-column: span 7;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.avatar {
    width: 80px;
    height: 80px;
    min-width: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--pakistan-green), var(--pakistan-green-light));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 600;
    box-shadow: 0 8px 16px rgba(16, 185, 129, 0.25);
    overflow: hidden;
}

.profile-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.profile-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
}

.profile-details {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detail-item .label {
    color: var(--text-tertiary);
    font-size: 0.9rem;
    font-weight: 500;
}

.detail-item .value {
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
    max-width: 65%;
    word-break: break-word;
}

/* Attendance Card */
.attendance-card h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.shift-info {
    background: rgba(255,255,255,0.6);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    border: 1px solid #e2e8f0;
}

.shift-info p {
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
}

.shift-info p:last-child {
    margin-bottom: 0;
}

.status-badge {
    padding: 0.35rem 0.75rem;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 600;
    background: white;
    border: 1px solid #cbd5e1;
    display: inline-block;
}

.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Stats */
.stats-grid {
    grid-column: span 12;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    margin-top: 0.5rem;
}

.stat-card {
    text-align: center;
    padding: 1.5rem;
}

.stat-card h4 {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--pakistan-green);
}

/* Lists */
.progress-card {
    grid-column: span 12;
}

.leave-tracker {
    margin-bottom: 1.5rem;
}

.leave-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 99px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(to right, var(--pakistan-green), var(--pakistan-green-light));
    border-radius: 99px;
    transition: width 1s ease-in-out;
}

/* Leave List / Logs */
.leave-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: rgba(255,255,255,0.6);
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.list-item:hover {
    border-color: #cbd5e1;
    background: rgba(255,255,255,0.9);
}

.item-main {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.item-main strong {
    color: var(--text-primary);
    font-size: 0.95rem;
}

.item-main span {
    color: var(--text-tertiary);
    font-size: 0.85rem;
}

.item-side {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Flash Messages */
.flash-messages {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    background: white;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 400px;
    border-left: 4px solid transparent;
    animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.alert-success {
    border-left-color: var(--success);
}

.alert-error {
    border-left-color: var(--danger);
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-tertiary);
    cursor: pointer;
    box-shadow: none;
    padding: 0;
    width: auto;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Scrollbars for list containers */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Fully Mobile Optimized */
@media (max-width: 900px) {
    .dashboard-grid {
        display: flex;
        flex-direction: column;
    }
}

@media (max-width: 600px) {
    body {
        padding: 1rem;
    }
    
    .glass-card {
        padding: 1.5rem;
        border-radius: var(--radius-md);
    }
    
    .dashboard-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        padding: 1rem;
    }
    
    .dashboard-header h2 {
        font-size: 1.25rem;
        text-align: center;
    }
    
    .btn-logout {
        width: 100%;
        text-align: center;
        padding: 0.75rem;
    }
    
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
    
    .detail-item {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 0.25rem;
    }
    
    .detail-item .value {
        text-align: center;
        max-width: 100%;
        word-break: break-word;
    }
    
    .action-buttons {
        grid-template-columns: 1fr;
    }
    
    .shift-info p {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
        margin-bottom: 1rem;
    }
    
    .stat-value {
        font-size: 2rem;
    }

    .list-item {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .item-side {
        justify-content: flex-start;
    }
}
