﻿/* ==========================================================================
   BDT Modern Pages CSS - Unified Styles for "newlook" Template
   For: Profile, User Management, Add User, Approve User, Change Password, Manuals, Login, Forgotten Password
   ========================================================================== */

/* ==========================================================================
   1. BASE STYLES & UTILITIES
   ========================================================================== */

/* Hidden Elements */
#error,
.hidden,
.js-form-error {
    display: none !important;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 1em;
    height: 1em;
    margin-right: 0.5em;
    vertical-align: text-bottom;
    border: 0.2em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border .75s linear infinite;
}

@keyframes spinner-border {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   2. PAGE LAYOUT COMPONENTS
   ========================================================================== */

/* Page Header - Used across all pages */
.page-header {
    background: var(--background-light);
    border-left: 4px solid var(--primary-color);
    padding: 1rem;
    margin-bottom: 2rem;
}

    .page-header h1 {
        color: var(--primary-color);
        font-size: 1.55rem;
        font-weight: 600;
    }

    .page-header h5 {
        color: var(--text-muted);
        font-weight: 500;
        margin-bottom: 0.75rem;
    }

    .page-header p {
        color: var(--text-muted);
        margin: 0;
        line-height: 1.6;
    }

/* Centered Page Container - For forms and focused content */
.password-page-container,
.centered-page-container {
    max-width: 600px;
    margin: 0 auto;
}

/* ==========================================================================
   3. LOGIN & AUTHENTICATION PAGES
   ========================================================================== */

.login-page,
.forgot-password-page {
    background: var(--background-light);
    min-height: calc(100vh - var(--header-height));
    display: flex;
    align-items: center;
    padding: 2rem 0;
}

.login-container,
.forgot-container {
    max-width: 450px;
    margin: 0 auto;
}

.forgot-container {
    max-width: 500px;
}

.login-card,
.forgot-card {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.login-header,
.forgot-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

    .login-header::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: url("data:image/svg+xml,%3Csvg width='65' height='48' viewBox='0 0 65 48' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='1.5' stroke-opacity='0.1'%3E%3Crect x='25.5' y='4' width='14' height='14' transform='rotate(45 32.5 11)'/%3E%3Crect x='13.5' y='17' width='14' height='14' transform='rotate(45 20.5 24)'/%3E%3Crect x='37.5' y='17' width='14' height='14' transform='rotate(45 44.5 24)'/%3E%3C/g%3E%3C/svg%3E");
        background-size: 70px 58px;
        opacity: 0.1;
    }

.login-title,
.forgot-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin: 0;
    color: var(--accent-color);
    position: relative;
    z-index: 1;
}

.login-subtitle,
.forgot-subtitle {
    font-size: 0.95rem;
    opacity: 0.9;
    margin-top: 0.5rem;
    position: relative;
    z-index: 1;
}

.login-body,
.forgot-body {
    padding: 2rem;
}

.login-btn {
    width: 100%;
    padding: 0.875rem;
    font-weight: 600;
    font-size: 1rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    background: var(--primary-color);
    border-color: var(--primary-color);
}

    .login-btn:hover {
        background: var(--primary-dark);
        border-color: var(--primary-dark);
        transform: translateY(-1px);
    }

.login-footer,
.forgot-footer {
    background: var(--background-light);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 2rem;
}

.login-actions,
.forgot-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

    .login-actions .btn,
    .forgot-actions .btn {
        flex: 1;
        font-size: 0.875rem;
        border-radius: var(--border-radius);
    }

.login-note {
    background: rgba(23, 162, 184, 0.1);
    border: 1px solid rgba(23, 162, 184, 0.2);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    line-height: 1.4;
}

    .login-note strong {
        color: var(--primary-color);
    }

.send-options {
    background: var(--background-light);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
}

    .send-options h6 {
        color: var(--primary-color);
        font-weight: 600;
        margin-bottom: 1rem;
        text-align: center;
    }

/* ==========================================================================
   4. PROFILE & USER MANAGEMENT COMPONENTS
   ========================================================================== */

/* Profile Actions Section */
.profile-actions-section {
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.profile-actions-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    position: relative;
    z-index: 10;
}

.profile-button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-end;
    align-items: center;
}

.profile-dropdown {
    position: relative;
    display: inline-block;
}

    .profile-dropdown .dropdown-menu {
        min-width: 200px;
        background: white;
        border: 1px solid var(--border-color);
        border-radius: var(--border-radius);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
        padding: 0.5rem 0;
        margin-top: 0.25rem;
        font-size: 0.9rem;
    }

    .profile-dropdown .dropdown-item {
        display: block;
        width: 100%;
        padding: 0.75rem 1rem;
        color: var(--text-dark);
        text-decoration: none;
        background: transparent;
        border: none;
        transition: all 0.2s ease;
        font-size: 0.9rem;
        white-space: nowrap;
    }

        .profile-dropdown .dropdown-item:hover,
        .profile-dropdown .dropdown-item:focus {
            background: var(--background-light);
            color: var(--primary-color);
        }

        .profile-dropdown .dropdown-item i {
            width: 16px;
            color: var(--text-muted);
            transition: color 0.2s ease;
            margin-right: 0.5rem;
        }

        .profile-dropdown .dropdown-item:hover i {
            color: var(--primary-color);
        }

/* Profile Cards */
.profile-card {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: var(--transition-base);
    overflow: hidden;
    background: white;
}

    .profile-card:hover {
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    }

    .profile-card .card-header {
        background: var(--primary-color);
        border: none;
        padding: 1.25rem 1.5rem;
        color: white;
        position: relative;
    }

        .profile-card .card-header.bg-info {
            background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%) !important;
        }

        .profile-card .card-header.bg-success {
            background: linear-gradient(135deg, #4CAF50 0%, #388E3C 100%) !important;
        }

        .profile-card .card-header.bg-secondary {
            background: linear-gradient(135deg, var(--text-muted) 0%, #555555 100%) !important;
        }

        .profile-card .card-header h5 {
            font-size: 1.1rem;
            font-weight: 600;
            letter-spacing: 0.5px;
            margin: 0;
        }

    .profile-card .card-body {
        padding: 1.5rem;
        background: white;
    }

.logo-container img {
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: var(--transition-base);
}

    .logo-container img:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        transform: scale(1.02);
    }

/* Access List */
.access-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

    .access-list li {
        padding: 0.75rem 0;
        border-bottom: 1px solid rgba(0,0,0,0.08);
        display: flex;
        align-items: center;
        transition: var(--transition-base);
        border-radius: var(--border-radius);
    }

        .access-list li:last-child {
            border-bottom: none;
        }

        .access-list li:hover {
            background: rgba(208, 189, 54, 0.05);
            margin: 0 -1rem;
            padding-left: 1rem;
            padding-right: 1rem;
        }

/* Info Rows */
.info-row {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

    .info-row:last-child {
        border-bottom: none;
    }

.info-label {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9rem;
}

.info-value {
    color: var(--text-dark);
    font-weight: 500;
}

/* ==========================================================================
   5. ACTION BUTTONS & SECTIONS
   ========================================================================== */

.actions-section {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

    .actions-section .btn {
        font-weight: 500;
        border-radius: var(--border-radius);
        transition: var(--transition-base);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

        .actions-section .btn:hover {
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        }

/* ==========================================================================
   6. TABLES & DATA DISPLAY
   ========================================================================== */

.table-container {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

    .table-container .table {
        margin: 0;
        border-radius: 0;
    }

.table thead th {
    background: var(--primary-color);
    color: white;
    border: none;
    font-weight: 600;
    padding: 1rem;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-top: 1px solid var(--border-light);
    font-size: 0.9rem;
}

.table tbody tr:hover {
    background-color: rgba(208, 189, 54, 0.05);
}

.table tbody tr.table-warning {
    background-color: rgba(255, 193, 7, 0.1);
    border-left: 4px solid var(--warning);
}

    .table tbody tr.table-warning:hover {
        background-color: rgba(255, 193, 7, 0.15);
    }

.table .btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
    border-radius: var(--border-radius);
    font-weight: 500;
}

.table .btn-danger {
    background: #dc3545;
    border-color: #dc3545;
}

    .table .btn-danger:hover {
        background: #c82333;
        border-color: #bd2130;
    }

/* No Data Message */
.no-data-row td {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 2rem !important;
}

/* ==========================================================================
   7. FORMS & INPUT CONTROLS
   ========================================================================== */

/* Form Container */
.form-container {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    margin-bottom: 2rem;
}

.form-header {
    background: var(--primary-color);
    color: white;
    padding: 1.25rem 1.5rem;
    margin: 0;
    border: none;
}

    .form-header h5 {
        margin: 0;
        font-size: 1.1rem;
        font-weight: 600;
        letter-spacing: 0.5px;
    }

    .form-header.warning {
        background: var(--warning);
        color: var(--text-dark);
    }

.form-body {
    padding: 2rem;
}

/* Form Controls */
.form-group {
    margin-bottom: 1.5rem;
}

    .form-group label {
        font-weight: 500;
        color: var(--text-dark);
        margin-bottom: 0.5rem;
        display: block;
    }

        .form-group label sup {
            color: var(--red);
        }

.form-control {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    background: white;
    display: block;
    width: 100%;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.login-card .form-control,
.forgot-card .form-control {
    height: calc(2.25rem + 2px);
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    border: 2px solid #e9ecef;
}

.form-control:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.2rem rgba(208, 189, 54, 0.25);
    background: white;
    outline: 0;
    color: var(--text-dark);
}

.login-card .form-control:focus,
.forgot-card .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 37, 74, 0.25);
}

.form-control.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.form-control.is-valid {
    border-color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

.invalid-feedback {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: none;
    width: 100%;
}

.form-control.is-invalid ~ .invalid-feedback {
    display: block;
}

/* Password Helper Text */
.password-help {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.form-submit-section {
    text-align: center;
    padding-top: 1rem;
    margin-top: 1.8rem;
}

.form-footer-section {
    background: var(--background-light);
    padding: 1rem 2rem;
    text-align: center;
    border-top: 1px solid var(--border-light);
    margin-top: 0;
}

/* ==========================================================================
   8. ALERT & MESSAGE COMPONENTS
   ========================================================================== */

/* Universal Alert Styling */
.alert {
    border-radius: var(--border-radius);
    border: none;
    margin-bottom: 1rem;
}

.alert-danger {
    background: rgba(220, 53, 69, 0.1);
    color: #721c24;
    border-left: 4px solid #dc3545;
}

    .alert-danger h5 {
        color: #721c24;
        font-weight: 600;
        margin-bottom: 0.75rem;
    }

.alert-success {
    background: rgba(40, 167, 69, 0.1);
    color: #155724;
    border-left: 4px solid #28a745;
}

/* Success Section */
.success-section {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    margin-bottom: 2rem;
}

    .success-section .alert-success {
        border: none;
        background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
        color: #155724;
        border-radius: var(--border-radius);
        border-left: 4px solid #28a745;
        padding: 2rem;
        margin: 0;
    }

    .success-section h2 {
        color: #155724;
        font-size: 1.5rem;
        font-weight: 600;
        margin: 0;
    }

    .success-section h5 {
        color: #155724;
        font-weight: 500;
        margin: 0.5rem 0;
    }

    .success-section p {
        font-size: 1rem;
        margin: 1rem 0 0 0;
    }

/* Warning Section */
.warning-section {
    margin-bottom: 2rem;
}

    .warning-section .alert {
        border: none;
        border-radius: var(--border-radius);
        border-left: 4px solid #ffc107;
        box-shadow: 0 2px 8px rgba(255, 193, 7, 0.1);
        background: #fff3cd;
        color: #856404;
    }

        .warning-section .alert h5 {
            color: #856404;
            font-weight: 600;
            margin: 0;
        }

/* Error Messages */
.error-section .alert {
    border: none;
    border-radius: var(--border-radius);
    border-left: 4px solid #dc3545;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.1);
    background: #f8d7da;
    color: #721c24;
}

    .error-section .alert h5 {
        color: #721c24;
        font-weight: 600;
        margin-bottom: 0.75rem;
    }

    .error-section .alert ul {
        margin: 0;
        padding-left: 1.5rem;
    }

/* Access Denied Styling */
.access-denied-section {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

    .access-denied-section .alert {
        border: none;
        border-radius: var(--border-radius);
        padding: 2rem;
        margin: 0;
    }

    .access-denied-section h2 {
        color: var(--warning);
        font-size: 1.5rem;
        font-weight: 600;
        margin-bottom: 1rem;
    }

/* Conflict Resolution Section */
.conflict-resolution {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 1px solid #ffc107;
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    margin: 1.5rem 0;
}

    .conflict-resolution h5 {
        color: #856404;
        font-weight: 600;
        margin-bottom: 1rem;
    }

/* ==========================================================================
   9. USER DETAILS & DISPLAY COMPONENTS
   ========================================================================== */

.user-details-section {
    background: var(--background-light);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-left: 4px solid var(--accent-color);
}

    .user-details-section h6 {
        color: var(--primary-color);
        font-weight: 600;
        margin-bottom: 1rem;
    }

.user-detail-item {
    display: flex;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

    .user-detail-item:last-child {
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
    }

.user-detail-label {
    font-weight: 600;
    color: var(--text-muted);
    min-width: 100px;
    margin-right: 1rem;
}

.user-detail-value {
    color: var(--text-dark);
}

/* ==========================================================================
   10. BUTTON STYLES
   ========================================================================== */

.btn:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

    .btn-primary:hover {
        background: var(--primary-dark);
        border-color: var(--primary-dark);
    }

/* Badge Styling */
.badge {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
    border-radius: var(--border-radius);
    font-weight: 500;
}

/* ==========================================================================
   11. RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 768px) {
    .password-page-container,
    .centered-page-container {
        max-width: 100%;
        padding: 0 1rem;
    }

    .login-container,
    .forgot-container {
        margin: 0 1rem;
    }

    .page-header {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }

        .page-header h1 {
            font-size: 1.5rem;
        }

    .profile-actions-card {
        padding: 1rem;
    }

    .profile-button-group {
        justify-content: flex-start;
        margin-top: 1rem;
    }

    .profile-dropdown .dropdown-menu {
        position: fixed !important;
        left: 1rem !important;
        right: 1rem !important;
        width: auto !important;
        min-width: auto !important;
        z-index: 1060;
    }

    .profile-card .card-header h5 {
        font-size: 1rem;
    }

    .profile-card .card-body {
        padding: 1rem;
    }

    .info-row {
        padding: 0.75rem 0;
    }

    .info-label, .info-value {
        font-size: 0.85rem;
    }

    .actions-section {
        padding: 1rem;
    }

    .form-body {
        padding: 1.5rem;
    }

    .login-body,
    .forgot-body {
        padding: 1.5rem;
    }

    .login-header,
    .forgot-header {
        padding: 1.5rem;
    }

    .login-title,
    .forgot-title {
        font-size: 1.5rem;
    }

    .login-footer,
    .forgot-footer {
        padding: 1.25rem 1.5rem;
    }

    .login-actions,
    .forgot-actions {
        flex-direction: column;
    }

        .login-actions .btn,
        .forgot-actions .btn {
            min-width: auto;
        }

    .success-section {
        padding: 1.5rem;
    }

        .success-section .alert-success {
            padding: 1.5rem;
        }

    .user-details-section {
        padding: 1rem;
    }

    .user-detail-item {
        flex-direction: column;
    }

    .user-detail-label {
        min-width: auto;
        margin-right: 0;
        margin-bottom: 0.25rem;
    }

    .form-footer-section {
        padding: 1rem;
    }

    .table-responsive {
        border-radius: var(--border-radius);
        overflow: hidden;
    }

    .table thead th,
    .table tbody td {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }

        .table thead th:first-child,
        .table tbody td:first-child {
            padding-left: 1rem;
        }

        .table thead th:last-child,
        .table tbody td:last-child {
            padding-right: 1rem;
        }

    #sendOptionButtons {
        flex-direction: column !important;
    }

        #sendOptionButtons button {
            margin-right: 0 !important;
            margin-bottom: 0.5rem;
            min-width: auto;
            width: 100%;
        }
}

@media (max-width: 576px) {
    .form-body {
        padding: 1rem;
    }

    .form-header {
        padding: 1rem;
    }

    .page-header h1 {
        font-size: 1.25rem;
    }

    .page-header h5 {
        font-size: 1rem;
    }

    .table thead th,
    .table tbody td {
        padding: 0.5rem 0.25rem;
        font-size: 0.8rem;
    }

    .table .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
}
