/* ============================================================
   COACTIVE IT SOLUTIONS - APPRAISAL SYSTEM
   Corporate HRMS Theme
   ============================================================ */

:root {
    --primary: #1a3a5c;
    --primary-light: #2c5282;
    --primary-dark: #0f2440;
    --accent: #3182ce;
    --accent-light: #4299e1;
    --success: #38a169;
    --success-light: #48bb78;
    --warning: #d69e2e;
    --danger: #e53e3e;
    --bg-light: #f7fafc;
    --bg-card: #ffffff;
    --text-primary: #1a202c;
    --text-secondary: #718096;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-light);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================================
   NAVBAR
   ============================================================ */
.bg-navbar {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    box-shadow: 0 2px 15px rgba(0,0,0,0.2);
    padding: 0.5rem 0;
}

.brand-icon {
    width: 38px;
    height: 38px;
    background: rgba(255,255,255,0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.navbar-brand span { font-size: 1rem; }

.nav-link {
    color: rgba(255,255,255,0.8) !important;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.6rem 1rem !important;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
    color: #fff !important;
    background: rgba(255,255,255,0.12);
}

.user-avatar {
    width: 34px;
    height: 34px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
}

.notification-bell { position: relative; }
.notification-badge {
    font-size: 0.65rem !important;
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.15); }
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
    padding: 1.5rem 0;
    flex: 1;
}

.app-footer {
    background: #fff;
    border-top: 1px solid var(--border);
}

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
    margin-bottom: 1.5rem;
}

.page-header h2 {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary);
}

.breadcrumb-item a { color: var(--accent); text-decoration: none; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.card:hover { box-shadow: var(--shadow-md); }

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.25rem;
    font-weight: 600;
}

.stat-card {
    border-left: 4px solid;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    opacity: 0.08;
}

.stat-card.primary { border-left-color: var(--accent); }
.stat-card.primary::after { background: var(--accent); }
.stat-card.success { border-left-color: var(--success); }
.stat-card.success::after { background: var(--success); }
.stat-card.warning { border-left-color: var(--warning); }
.stat-card.warning::after { background: var(--warning); }
.stat-card.danger { border-left-color: var(--danger); }
.stat-card.danger::after { background: var(--danger); }

.stat-card .stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
}

.stat-card.primary .stat-icon { background: var(--accent); }
.stat-card.success .stat-icon { background: var(--success); }
.stat-card.warning .stat-icon { background: var(--warning); }
.stat-card.danger .stat-icon { background: var(--danger); }

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================================
   CTC DISPLAY - BLINKING ANIMATION
   ============================================================ */
.ctc-card {
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
    color: #fff;
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.ctc-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.ctc-amount {
    font-size: 3rem;
    font-weight: 800;
    animation: blink-ctc 1.5s ease-in-out infinite;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
    position: relative;
    z-index: 1;
}

.ctc-amount.no-blink {
    animation: none;
}

@keyframes blink-ctc {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.05); }
}

.ctc-label {
    font-size: 0.9rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    z-index: 1;
}

.ctc-sublabel {
    font-size: 0.8rem;
    opacity: 0.75;
    position: relative;
    z-index: 1;
}

/* ============================================================
   GOOD NOTES CARD
   ============================================================ */
.good-notes-card {
    background: linear-gradient(135deg, #f6e05e 0%, #ecc94b 100%);
    border-radius: var(--radius);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.good-notes-card .note-icon {
    font-size: 3rem;
    position: absolute;
    top: 10px;
    right: 15px;
    opacity: 0.15;
}

.good-notes-card h6 {
    color: #744210;
    font-weight: 700;
}

.good-notes-card p {
    color: #5a3e0a;
    font-weight: 500;
}

/* ============================================================
   CTC COLOR VARIANTS (override via inline style on .ctc-card)
   ============================================================ */
.ctc-card.ctc-decrement {
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
}

.ctc-card.ctc-no-change {
    background: linear-gradient(135deg, #dd6b20 0%, #c05621 100%);
}

.ctc-card.ctc-increment {
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
}

/* Share toggle styling */
.form-switch .form-check-input:checked {
    background-color: var(--success);
    border-color: var(--success);
}

.form-switch .form-check-input {
    width: 3em;
    height: 1.5em;
    cursor: pointer;
}

/* ============================================================
   STATUS TIMELINE
   ============================================================ */
.status-timeline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    position: relative;
}

.status-timeline::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--border);
    z-index: 0;
}

.timeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    flex: 1;
}

.timeline-dot {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: var(--transition);
}

.timeline-step.active .timeline-dot {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(49, 130, 206, 0.2);
}

.timeline-step.completed .timeline-dot {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}

.timeline-label {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.timeline-step.active .timeline-label { color: var(--accent); }
.timeline-step.completed .timeline-label { color: var(--success); }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-body {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 50%, #1a365d 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-wrapper {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}

.login-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    padding: 2rem;
    text-align: center;
}

.login-logo {
    width: 60px;
    height: 60px;
    background: rgba(255,255,255,0.15);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin: 0 auto 1rem;
}

.login-body-content { padding: 2rem; }
.login-footer {
    text-align: center;
    padding: 1rem 2rem;
    border-top: 1px solid var(--border);
}

.btn-login {
    padding: 0.7rem;
    font-weight: 600;
    font-size: 1rem;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary-light) 100%);
    border: none;
    transition: var(--transition);
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(49,130,206,0.4);
}

/* ============================================================
   TABLES
   ============================================================ */
.table-modern {
    border-collapse: separate;
    border-spacing: 0;
}

.table-modern thead th {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.75rem 1rem;
    border: none;
}

.table-modern thead th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.table-modern thead th:last-child { border-radius: 0 var(--radius-sm) 0 0; }

.table-modern tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
}

.table-modern tbody tr { transition: var(--transition); }
.table-modern tbody tr:hover { background: rgba(49,130,206,0.04); }

/* ============================================================
   STAR RATING
   ============================================================ */
.star-rating {
    display: flex;
    gap: 4px;
    flex-direction: row-reverse;
    justify-content: flex-end;
}

.star-rating input { display: none; }

.star-rating label {
    cursor: pointer;
    font-size: 1.5rem;
    color: #cbd5e0;
    transition: color 0.2s;
}

.star-rating label:hover,
.star-rating label:hover ~ label,
.star-rating input:checked ~ label {
    color: #ecc94b;
}

.star-display {
    color: #ecc94b;
    font-size: 1rem;
}

/* ============================================================
   FORM STYLES
   ============================================================ */
.form-control:focus, .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(49,130,206,0.15);
}

.form-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
}

.section-card {
    border-radius: var(--radius);
    border: none;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}

.section-card .card-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    border-radius: var(--radius) var(--radius) 0 0 !important;
    font-weight: 600;
    padding: 0.85rem 1.25rem;
}

.section-card .card-header i { margin-right: 0.5rem; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn { border-radius: var(--radius-sm); font-weight: 500; transition: var(--transition); }
.btn:hover { transform: translateY(-1px); }

.btn-primary-custom {
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary-light) 100%);
    border: none;
    color: #fff;
}
.btn-primary-custom:hover {
    box-shadow: 0 5px 15px rgba(49,130,206,0.3);
    color: #fff;
}

.btn-success-custom {
    background: linear-gradient(135deg, var(--success) 0%, var(--success-light) 100%);
    border: none;
    color: #fff;
}

.btn-outline-action {
    border: 2px solid var(--accent);
    color: var(--accent);
    font-weight: 600;
}
.btn-outline-action:hover {
    background: var(--accent);
    color: #fff;
}

/* ============================================================
   BADGE
   ============================================================ */
.badge { font-weight: 500; font-size: 0.75rem; padding: 0.4em 0.8em; }

/* ============================================================
   CONFETTI (JS-driven via class)
   ============================================================ */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -10px;
    animation: confetti-fall 3s ease-out forwards;
}

@keyframes confetti-fall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .ctc-amount { font-size: 2rem; }
    .stat-card .stat-value { font-size: 1.3rem; }
    .status-timeline { flex-wrap: wrap; gap: 0.5rem; }
    .timeline-step { flex: 0 0 auto; }
}

@media (max-width: 576px) {
    .login-wrapper { max-width: 100%; }
    .login-header { padding: 1.5rem; }
    .login-body-content { padding: 1.5rem; }
}

/* ============================================================
   DROPDOWN ANIMATION
   ============================================================ */
.dropdown-menu {
    border: none;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-sm);
    animation: dropdown-in 0.2s ease;
}

@keyframes dropdown-in {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   LOADING SPINNER
   ============================================================ */
.page-loader {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-state i {
    font-size: 4rem;
    color: var(--border);
    margin-bottom: 1rem;
}

.empty-state h5 { color: var(--text-secondary); }

/* ============================================================
   MODAL OVERRIDES
   ============================================================ */
.modal-content {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    border-radius: var(--radius) var(--radius) 0 0;
}

.modal-header .btn-close { filter: brightness(0) invert(1); }
