/* MyeAtt Custom Styles */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

html {
    overflow-x: hidden;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Navigation */
.modern-navbar {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 0.4rem 0;
}

.modern-navbar .container-fluid {
    padding-left: 1rem;
    padding-right: 1rem;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.2rem;
    color: #fff !important;
    transition: opacity 0.3s ease;
    padding: 0.3rem 0.5rem;
}

.navbar-brand:hover {
    opacity: 0.9;
}

.navbar-brand i {
    font-size: 1.3rem;
    vertical-align: middle;
}

.brand-text {
    font-size: 1.1rem;
    letter-spacing: 0.2px;
}

.modern-navbar .nav-link {
    color: rgba(255, 255, 255, 0.95) !important;
    font-weight: 500;
    font-size: 0.85rem;
    padding: 0.4rem 0.6rem !important;
    border-radius: 5px;
    transition: all 0.2s ease;
    margin: 0 0.1rem;
    white-space: nowrap;
}

.modern-navbar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff !important;
}

.modern-navbar .nav-link.active {
    background-color: rgba(255, 255, 255, 0.15);
    color: #fff !important;
}

.modern-navbar .nav-link i {
    font-size: 0.95rem;
    vertical-align: middle;
    margin-right: 0.25rem;
}

/* Responsive navbar adjustments */
@media (max-width: 1400px) {
    .modern-navbar .nav-link {
        font-size: 0.8rem;
        padding: 0.4rem 0.5rem !important;
    }
    
    .brand-text {
        font-size: 1rem;
    }
}

@media (max-width: 1200px) {
    .modern-navbar .nav-link {
        font-size: 0.75rem;
        padding: 0.3rem 0.4rem !important;
        margin: 0 0.05rem;
    }
    
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .brand-text {
        font-size: 0.95rem;
    }
}

@media (min-width: 992px) {
    .modern-navbar .navbar-collapse {
        flex-wrap: nowrap;
    }
    
    .modern-navbar .navbar-nav {
        flex-wrap: nowrap;
    }
}

.modern-navbar .dropdown-menu {
    border: none;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    border-radius: 8px;
    padding: 0.5rem;
    margin-top: 0.5rem;
}

.modern-navbar .dropdown-item {
    border-radius: 6px;
    padding: 0.6rem 1rem;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.9rem;
}

.modern-navbar .dropdown-item:hover {
    background-color: #f0f4ff;
    color: #1e3c72;
    padding-left: 1.2rem;
}

.modern-navbar .dropdown-item i {
    width: 20px;
    text-align: center;
    color: #2a5298;
}

.modern-navbar .dropdown-header {
    color: #6c757d;
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.5rem 1rem 0.3rem;
}

.modern-navbar .dropdown-divider {
    margin: 0.5rem 0;
    opacity: 0.15;
}

.modern-navbar .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.5);
    padding: 0.5rem;
}

.modern-navbar .navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
}

.modern-navbar .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 0.95)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Cards */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.card-header {
    background-color: #fff;
    border-bottom: 2px solid var(--primary-color);
    font-weight: 600;
    font-size: 1.1rem;
}

/* Dashboard Stats Cards */
.stat-card {
    padding: 1.5rem;
    border-radius: 12px;
    color: white;
    margin-bottom: 1rem;
}

.stat-card.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-card.success {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%);
}

.stat-card.danger {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
}

.stat-card.warning {
    background: linear-gradient(135deg, #f2994a 0%, #f2c94c 100%);
}

.stat-card.info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.stat-card h3 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-card p {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 0;
}

/* Attendance Page */
.attendance-container {
    max-width: 600px;
    margin: 2rem auto;
}

.time-display {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.time-display h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.time-display p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.attendance-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.attendance-buttons .btn {
    flex: 1;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
}

.attendance-status {
    padding: 1.5rem;
    border-radius: 12px;
    background-color: white;
    margin-top: 2rem;
}

.status-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.status-badge.checked-in {
    background-color: #d1f2eb;
    color: #0f5132;
}

.status-badge.checked-out {
    background-color: #cfe2ff;
    color: #084298;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    max-width: 450px;
    width: 100%;
    padding: 2rem;
}

.login-card .card-body {
    padding: 2rem;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h2 {
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--secondary-color);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Table Styles */
.table-responsive {
    border-radius: 8px;
    overflow: hidden;
}

.table {
    margin-bottom: 0;
}

.table thead th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    border: none;
    padding: 1rem;
}

.table tbody tr {
    transition: background-color 0.2s ease;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
}

/* Badges */
.badge {
    padding: 0.5rem 0.75rem;
    font-weight: 600;
    border-radius: 6px;
}

/* Buttons */
.btn {
    border-radius: 8px;
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}

.btn-success {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%);
    border: none;
}

.btn-danger {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    border: none;
}

/* PWA Install Button */
#installButton {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: none;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

#installButton:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

/* Loading Spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Responsive Design */
@media (max-width: 768px) {
    .attendance-buttons {
        flex-direction: column;
    }

    .stat-card h3 {
        font-size: 2rem;
    }

    .time-display h1 {
        font-size: 2rem;
    }

    .navbar-brand {
        font-size: 1.2rem;
    }

    .card {
        margin-bottom: 1rem;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .btn,
    #installButton {
        display: none !important;
    }

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

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #0a58ca;
}

/* Footer */
.footer {
    background-color: var(--dark-color);
    color: white;
    padding: 2rem 0;
    margin-top: 4rem;
}

.footer a {
    color: white;
    text-decoration: none;
}

.footer a:hover {
    color: var(--primary-color);
}

/* Profile Page */
.profile-header {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid white;
    margin-bottom: 1rem;
}

.profile-info {
    padding: 2rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid #e9ecef;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: var(--secondary-color);
}

.info-value {
    color: var(--dark-color);
}

/* Leave Request Form */
.leave-form {
    max-width: 600px;
    margin: 2rem auto;
}

/* Attendance History */
.history-filters {
    background-color: white;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

/* Dashboard Charts */
.chart-container {
    position: relative;
    height: 300px;
    padding: 1rem;
}

/* Status Icons */
.status-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.status-icon.success {
    background-color: #d1f2eb;
    color: #0f5132;
}

.status-icon.danger {
    background-color: #f8d7da;
    color: #842029;
}

.status-icon.warning {
    background-color: #fff3cd;
    color: #664d03;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--secondary-color);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Offline Indicator */
.offline-indicator {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background-color: var(--danger-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    z-index: 1050;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
}

.offline-indicator.show {
    transform: translateX(-50%) translateY(0);
}

/* Update Banner */
.update-banner {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    z-index: 1040;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

/* PWA Install Prompt */
.install-prompt {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 400px;
    width: calc(100% - 40px);
    z-index: 1030;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

.install-prompt-content {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
}

.install-prompt-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--secondary-color);
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    transition: color 0.2s;
}

.install-prompt-close:hover {
    color: var(--dark-color);
}

.install-prompt-icon img {
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.install-prompt-text {
    flex: 1;
}

.install-prompt-text h5 {
    margin: 0 0 0.25rem 0;
    font-size: 1.1rem;
    color: var(--dark-color);
}

.install-prompt-text p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--secondary-color);
}

/* iOS Safe Area Support */
@supports (padding: max(0px)) {
    body {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }
    
    .navbar {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
}

/* Standalone PWA Mode */
@media all and (display-mode: standalone) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .install-prompt {
        display: none !important;
    }
}
