/* ============================================
   GEARGUARD APPLICATION STYLES
   Shared styles for all protected pages
   ============================================ */

/* ========== App Layout ========== */
.app-page {
    min-height: 100vh;
    background: var(--black);
    padding-top: 100px;
    cursor: auto !important;
}

/* Override custom cursor for app pages */
.app-page .custom-cursor {
    display: none !important;
}

.app-page * {
    cursor: inherit;
}

.app-page a,
.app-page button,
.app-page [role="button"],
.app-page .clickable {
    cursor: pointer !important;
}

/* ========== App Header ========== */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-bottom: 1px solid rgba(255, 215, 0, 0.15);
    padding: 0.75rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.app-header .header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.app-header .header-logo:hover {
    transform: scale(1.02);
}

.app-header .header-logo:hover .logo-text {
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.app-header .logo-icon {
    font-size: 1.5rem;
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.3));
    transition: all 0.3s ease;
}

.app-header .header-logo:hover .logo-icon {
    filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.6));
}

.app-header .logo-text {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 2px;
    transition: all 0.3s ease;
}

/* App Navigation */
.app-nav {
    display: flex;
    gap: 0.25rem;
}

.app-nav .nav-link {
    padding: 0.6rem 1.1rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.app-nav .nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.app-nav .nav-link:hover::before {
    width: 80%;
}

.app-nav .nav-link:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

.app-nav .nav-link.active {
    color: var(--gold);
    background: rgba(255, 215, 0, 0.12);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.15);
}

.app-nav .nav-link.active::before {
    width: 60%;
    opacity: 0.8;
}

/* Header User */
.header-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    background: rgba(255, 215, 0, 0.1);
}

.user-name {
    color: var(--white);
    font-size: 0.85rem;
    font-weight: 500;
}

.btn-logout {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.2);
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    opacity: 0.8;
    transition: all 0.3s ease;
    padding: 0.4rem 0.6rem;
    color: #ff6b6b;
}

.btn-logout:hover {
    opacity: 1;
    transform: scale(1.05);
    background: rgba(255, 107, 107, 0.2);
    box-shadow: 0 0 15px rgba(255, 107, 107, 0.3);
}

/* ========== Main Content ========== */
.app-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-header {
    margin-bottom: 2.5rem;
    position: relative;
}

.page-header::after {
    content: '';
    position: absolute;
    bottom: -1rem;
    left: 0;
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, var(--gold), transparent);
    border-radius: 2px;
}

.page-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    color: var(--white);
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.page-subtitle {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1rem;
}

/* ========== KPI Grid ========== */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.kpi-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.5rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.05) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.kpi-card:hover::before {
    opacity: 1;
}

.kpi-card:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: rgba(255, 215, 0, 0.3);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(255, 215, 0, 0.1);
}

.kpi-icon {
    font-size: 2rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 215, 0, 0.05) 100%);
    border-radius: 14px;
    border: 1px solid rgba(255, 215, 0, 0.2);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.kpi-card:hover .kpi-icon {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
}

.kpi-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.kpi-value {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--white);
    line-height: 1;
    transition: all 0.3s ease;
}

.kpi-card:hover .kpi-value {
    color: var(--gold);
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.kpi-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
}

.kpi-warning.highlight {
    border-color: var(--danger);
    animation: pulseWarning 2s infinite;
}

.kpi-warning .kpi-icon {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.2) 0%, rgba(255, 107, 107, 0.05) 100%);
    border-color: rgba(255, 107, 107, 0.3);
}

.kpi-success .kpi-icon {
    background: linear-gradient(135deg, rgba(78, 205, 196, 0.2) 0%, rgba(78, 205, 196, 0.05) 100%);
    border-color: rgba(78, 205, 196, 0.3);
}

@keyframes pulseWarning {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.4);
        border-color: rgba(255, 107, 107, 0.3);
    }
    50% {
        box-shadow: 0 0 20px 5px rgba(255, 107, 107, 0.2);
        border-color: rgba(255, 107, 107, 0.6);
    }
}

/* ========== Dashboard Grid ========== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.dashboard-section {
    padding: 1.75rem;
    transition: all 0.4s ease;
}

.dashboard-section:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4), 0 0 30px rgba(255, 215, 0, 0.05);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 215, 0, 0.15);
    position: relative;
}

.section-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 50px;
    height: 2px;
    background: var(--gold);
    border-radius: 2px;
}

.section-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-content {
    min-height: 200px;
}

/* ========== Alert Items ========== */
.alert-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    margin-bottom: 0.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 3px solid transparent;
    cursor: pointer;
}

.alert-item:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.alert-item.overdue {
    background: rgba(255, 107, 107, 0.08);
    border-left-color: var(--danger);
}

.alert-item.overdue:hover {
    background: rgba(255, 107, 107, 0.12);
}

.alert-item.priority-critical {
    border-left-color: #ff4444;
}

.alert-item.priority-high {
    border-left-color: #ff8c00;
}

.alert-priority {
    font-size: 1.3rem;
    transition: transform 0.3s ease;
}

.alert-item:hover .alert-priority {
    transform: scale(1.2);
}

.alert-content {
    flex: 1;
}

.alert-content h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 0.3rem;
    transition: color 0.3s ease;
}

.alert-item:hover .alert-content h4 {
    color: var(--gold);
}

.alert-content p {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.alert-equipment {
    margin-right: 0.5rem;
}

.alert-action {
    color: var(--gold);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    background: rgba(255, 215, 0, 0.1);
    transition: all 0.3s ease;
}

.alert-action:hover {
    background: rgba(255, 215, 0, 0.2);
    transform: translateX(3px);
}

/* ========== Activity Items ========== */
.activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.activity-item:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(5px);
}

.activity-icon {
    font-size: 1.4rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.activity-item:hover .activity-icon {
    transform: scale(1.1);
    background: rgba(255, 215, 0, 0.1);
}

.activity-content {
    flex: 1;
}

.activity-content h4 {
    font-size: 0.9rem;
    color: var(--white);
    margin-bottom: 0.25rem;
    transition: color 0.3s ease;
}

.activity-item:hover .activity-content h4 {
    color: var(--gold);
}

.activity-content p {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.activity-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
}

.activity-stage {
    font-size: 0.7rem;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stage-new {
    background: rgba(100, 149, 237, 0.2);
    color: #6495ed;
    border: 1px solid rgba(100, 149, 237, 0.3);
}
.stage-in_progress {
    background: rgba(255, 165, 0, 0.2);
    color: #ffa500;
    border: 1px solid rgba(255, 165, 0, 0.3);
}
.stage-repaired {
    background: rgba(78, 205, 196, 0.2);
    color: #4ecdc4;
    border: 1px solid rgba(78, 205, 196, 0.3);
}
.stage-scrap {
    background: rgba(128, 128, 128, 0.2);
    color: #888;
    border: 1px solid rgba(128, 128, 128, 0.3);
}

.activity-time {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

/* ========== Quick Actions ========== */
.quick-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    padding-top: 1rem;
}

.btn-action {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.9rem 1.8rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-action::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-action:hover::before {
    left: 100%;
}

.btn-action.btn-primary {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: var(--black);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.btn-action.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.4), 0 0 30px rgba(255, 215, 0, 0.15);
}

.btn-action.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--white);
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.btn-action.btn-secondary:hover {
    background: rgba(255, 215, 0, 0.1);
    border-color: rgba(255, 215, 0, 0.4);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.btn-action span {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.btn-action:hover span {
    transform: scale(1.2);
}

/* ========== Empty & Error States ========== */
.empty-state, .error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    padding: 2rem;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.6;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.empty-state p, .error-state p {
    font-size: 0.95rem;
    max-width: 250px;
    line-height: 1.5;
}

/* ========== Loading Spinner ========== */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    gap: 1rem;
}

.spinner {
    width: 45px;
    height: 45px;
    border: 3px solid rgba(255, 215, 0, 0.15);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ========== Badges ========== */
.badge {
    font-size: 0.65rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-overdue {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    color: var(--white);
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.4); }
    50% { box-shadow: 0 0 10px 2px rgba(255, 107, 107, 0.3); }
}

/* ========== Toast Notifications ========== */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: rgba(15, 15, 15, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 0, 0, 0.3);
    transform: translateY(100px) scale(0.95);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10000;
}

.toast.show {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.toast-success {
    border-color: var(--success);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.5), 0 0 20px rgba(78, 205, 196, 0.2);
}
.toast-error {
    border-color: var(--danger);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 107, 107, 0.2);
}

.toast-icon {
    font-size: 1.3rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.toast-success .toast-icon {
    color: var(--success);
    background: rgba(78, 205, 196, 0.15);
}
.toast-error .toast-icon {
    color: var(--danger);
    background: rgba(255, 107, 107, 0.15);
}

.toast-message {
    color: var(--white);
    font-size: 0.9rem;
    font-weight: 500;
}

/* ========== Responsive ========== */
@media (max-width: 1024px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .app-header {
        padding: 0.5rem 1rem;
    }

    .app-nav {
        display: none;
    }

    .app-main {
        padding: 1rem;
    }

    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .quick-actions {
        flex-direction: column;
    }

    .btn-action {
        width: 100%;
        justify-content: center;
    }
}

