/* Portal Leaves Modern Styling - Scoped to Leave Portal Only */

:root {
    --portal-primary: #667eea;
    --portal-primary-dark: #764ba2;
    --portal-secondary: #00bcd4;
}

/* Leave Balance Cards */
.leave-balance-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    border-radius: 16px;
    overflow: hidden;
    background: white;
    position: relative;
    height: 100%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.leave-balance-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #667eea, #00bcd4);
}

.leave-balance-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 70px rgba(102, 126, 234, 0.25);
}

.leave-balance-card .card-body {
    padding: 2.5rem 1.5rem;
    text-align: center;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
}

.leave-balance-card .card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #667eea, #00bcd4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 4px 8px rgba(102, 126, 234, 0.2));
}

.leave-balance-card .card-title {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #667eea;
    margin-bottom: 1rem;
}

.leave-balance-card .display-5 {
    font-size: 3rem;
    font-weight: 900;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    line-height: 1;
}

/* Leave Table Styling */
.leaves-table {
    margin-top: 2.5rem;
}

.leaves-table thead th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 800;
    border: none;
    padding: 1.5rem 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.85rem;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.leaves-table tbody tr {
    border: none;
    border-bottom: 2px solid #e9ecef;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.leaves-table tbody tr::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: transparent;
    transition: all 0.3s ease;
}

.leaves-table tbody tr:hover {
    background: linear-gradient(90deg, #f3e5f5 0%, #e0f2f1 100%);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.1);
}

.leaves-table tbody tr:hover::before {
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
}

.leaves-table tbody td {
    padding: 1.5rem 1rem;
    vertical-align: middle;
    color: #2c3e50;
    font-weight: 500;
}

/* Status Badges */
.badge.bg-success {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%) !important;
    color: white;
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.35);
    padding: 0.7rem 1.2rem;
    border-radius: 25px;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.badge.bg-warning {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%) !important;
    color: white;
    box-shadow: 0 6px 20px rgba(255, 152, 0, 0.35);
    padding: 0.7rem 1.2rem;
    border-radius: 25px;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.badge.bg-danger {
    background: linear-gradient(135deg, #f44336 0%, #e53935 100%) !important;
    color: white;
    box-shadow: 0 6px 20px rgba(244, 67, 54, 0.35);
    padding: 0.7rem 1.2rem;
    border-radius: 25px;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.badge.bg-primary {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%) !important;
    color: white;
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.35);
    padding: 0.7rem 1.2rem;
    border-radius: 25px;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.badge.bg-light {
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%) !important;
    color: #424242 !important;
    padding: 0.7rem 1.2rem;
    border-radius: 25px;
    font-weight: 700;
    font-size: 0.8rem;
}

/* Leave Detail Card */
.card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    padding: 2rem 1.5rem;
    color: white;
}

.card-header h4,
.card-header h5 {
    color: white;
    font-weight: 700;
    margin-bottom: 0;
}

.card-body {
    padding: 2.5rem;
    background: #fafafa;
}

.card-body h6 {
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #667eea;
    margin-bottom: 0.75rem;
}

.card-body p {
    color: #2c3e50;
    font-weight: 500;
    margin-bottom: 0;
}

.card-body hr {
    margin: 1.5rem 0;
    border-color: #e0e0e0;
    opacity: 0.5;
}

/* Avatar Circle */
.avatar-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    flex-shrink: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
    font-size: 1rem;
}

.avatar-initial {
    text-transform: uppercase;
}

/* Comments Section */
.comments-section {
    max-height: 450px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.comments-section::-webkit-scrollbar {
    width: 8px;
}

.comments-section::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.comments-section::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
}

.comments-section::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

.comments-section .d-flex {
    align-items: flex-start;
    margin-bottom: 1rem;
}

.comments-section h6 {
    font-weight: 700;
    color: #2c3e50;
    font-size: 0.95rem;
}

.comments-section p {
    line-height: 1.6;
    color: #555;
    font-size: 0.95rem;
}

.comments-section small {
    color: #9e9e9e;
    font-size: 0.8rem;
}

.comments-section hr {
    margin: 1rem 0;
    border-color: #e0e0e0;
}

/* Apply Leave Form */
.apply-leave-form {
    background: white;
    border-radius: 16px;
    padding: 3rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.form-section {
    margin-bottom: 2.5rem;
}

.form-section-title {
    font-weight: 800;
    font-size: 1.2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 4px solid #667eea;
    display: flex;
    align-items: center;
}

.form-section-title i {
    margin-right: 1rem;
    font-size: 1.5rem;
    color: #667eea;
}

.form-label {
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    display: block;
}

.form-control,
.form-select {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 0.95rem 1rem;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 500;
}

.form-control:focus,
.form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.4rem rgba(102, 126, 234, 0.15);
    outline: none;
}

.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23667eea' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    padding-right: 2.5rem;
}

.form-select option {
    background: white;
    color: #2c3e50;
    font-weight: 500;
}

.form-text {
    color: #667eea;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    font-weight: 600;
}

.form-text.text-muted {
    color: #9e9e9e !important;
    font-weight: normal;
}

/* Textarea */
textarea.form-control {
    resize: vertical;
    min-height: 120px;
    font-family: 'Segoe UI', sans-serif;
}

/* File Upload */
#attachment_input {
    display: none;
}

.file-input-label {
    display: inline-block;
    padding: 0.95rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.file-input-label:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.5);
}

#attachment-feedback {
    display: block;
    margin-top: 0.5rem;
    color: #667eea;
    font-weight: 600;
    font-size: 0.85rem;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1.5rem;
    margin-top: 3rem;
    justify-content: center;
    padding-top: 2rem;
    border-top: 2px solid #e9ecef;
}

.form-actions .btn {
    padding: 0.9rem 3rem;
    font-weight: 800;
}

/* Comment Form */
.comment-form textarea {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 0.75rem;
    font-size: 0.95rem;
    resize: vertical;
    transition: all 0.3s ease;
}

.comment-form textarea:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.4rem rgba(102, 126, 234, 0.15);
    outline: none;
}

.comment-form .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    font-weight: 700;
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.comment-form .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
    color: white;
    text-decoration: none;
}

/* Responsive */
@media (max-width: 768px) {
    .apply-leave-form {
        padding: 1.5rem;
    }

    .leave-balance-card .display-5 {
        font-size: 2.2rem;
    }

    .leaves-table {
        font-size: 0.9rem;
    }

    .leaves-table thead th {
        padding: 1rem 0.75rem;
    }

    .leaves-table tbody td {
        padding: 1rem 0.75rem;
        font-size: 0.9rem;
    }

    .avatar-circle {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }

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

    .form-actions .btn {
        width: 100%;
        padding: 0.9rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .leave-balance-card .display-5 {
        font-size: 2rem;
    }

    .row.g-3 {
        --bs-gutter-x: 0.75rem;
    }

    .col-md-6 {
        margin-bottom: 1rem;
    }
}
