/* Portal Leaves Professional Business Styling */

:root {
    --portal-primary: #1a365d; /* Deep navy blue */
    --portal-primary-dark: #2d3748; /* Dark gray */
    --portal-secondary: #38a169; /* Professional green */
    --portal-accent: #e53e3e; /* Professional red for alerts */
    --portal-light: #f7fafc; /* Light gray background */
    --portal-text: #2d3748; /* Dark text */
    --portal-border: #e2e8f0; /* Light border */
}

/* 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, var(--portal-primary), var(--portal-secondary));
}

.leave-balance-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(26, 54, 93, 0.15);
}

.leave-balance-card .card-body {
    padding: 2rem 1.5rem;
    text-align: center;
    background: var(--portal-light);
}

.leave-balance-card .card-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--portal-primary);
    opacity: 0.8;
}

.leave-balance-card .card-title {
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--portal-text);
    margin-bottom: 1rem;
}

.leave-balance-card .display-5 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--portal-primary);
    margin: 0;
    line-height: 1;
}

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

.leaves-table thead th {
    background: var(--portal-primary);
    color: white;
    font-weight: 600;
    border: none;
    padding: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.8rem;
}

.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: var(--portal-light);
    box-shadow: 0 4px 16px rgba(26, 54, 93, 0.1);
}

.leaves-table tbody tr:hover::before {
    background: var(--portal-primary);
}

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

/* Status Badges */
.badge.bg-success {
    background: var(--portal-secondary) !important;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.badge.bg-warning {
    background: #d69e2e !important;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.badge.bg-danger {
    background: var(--portal-accent) !important;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.badge.bg-primary {
    background: var(--portal-primary) !important;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.badge.bg-light {
    background: var(--portal-border) !important;
    color: var(--portal-text) !important;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.75rem;
}

/* 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: var(--portal-primary);
    border: none;
    padding: 1.5rem;
    color: white;
}

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

.card-body {
    padding: 2rem;
    background: var(--portal-light);
}


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

/* Hide default portal cards - Your Invoices and Connection & Security */
/* Target the cards in the portal home page */
.o_portal_my_home .card mb-4,
.o_portal_my_home .card.shadow-sm,
.o_portal_my_home .card a[href*='/my/invoices'],
.o_portal_my_home .card a[href*='/my/security'],
.o_portal_my_home .card a[href*='/my/account'] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
}

/* More aggressive hiding using :has() selector */
.o_portal_my_home .card:has(a[href*='/my/invoices']),
.o_portal_my_home .card:has(a[href*='/my/security']),
.o_portal_my_home .card:has(a[href*='/my/account']) {
  display: none !important;
  visibility: hidden !important;
}

/* Target specific portal cards by their content */
.o_portal_my_home .card:has(.fa-file-text),
.o_portal_my_home .card:has(.fa-shield) {
  display: none !important;
}

/* Also hide in the sidebar list */
.hr-portal-sidebar .list-group-item a[href*='/my/invoices'],
.hr-portal-sidebar .list-group-item a[href*='/my/security'] {
  display: none !important;
}

/* Sidebar menu styling */
.hr-portal-sidebar {
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    border-radius: 18px;
    padding: 0.5rem;
    background: white;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}
.hr-portal-sidebar .card {
    border: none;
    box-shadow: none;
    background: transparent;
}
.hr-portal-sidebar .list-group-item {
    border: none;
    border-radius: 0.75rem;
    padding: 0.8rem 1rem;
    margin-bottom: 0.25rem;
    color: var(--portal-text);
    font-weight: 600;
    transition: all 0.2s ease;
}
.hr-portal-sidebar .list-group-item:hover {
    background: rgba(56, 161, 105, 0.1);
}
.hr-portal-sidebar .list-group-item.active {
    background: linear-gradient(135deg, var(--portal-primary), var(--portal-secondary));
    color: white;
    box-shadow: 0 12px 20px rgba(26, 54, 93, 0.14);
}
.hr-portal-sidebar .list-group-item i {
    width: 22px;
    text-align: center;
}

/* Main content margin for sidebar */
@media (min-width: 992px) {
    .hr-portal-main-content {
        margin-left: 290px;
    }
}

/* Card Body Styling */
.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;
    }
}
