﻿/* ========================================
   Contract Management System CSS
   ======================================== */

/* Page Header Styles */
.ui-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

    .ui-page-header h2 {
        margin: 0;
        color: #495057;
        font-weight: 600;
    }

.ui-page-actions {
    display: flex;
    gap: 0.75rem;
}

/* Statistics Cards */
.ui-stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    border-left: 4px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

    .ui-stat-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    }

    .ui-stat-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: linear-gradient(90deg, transparent 0%, var(--stat-color) 50%, transparent 100%);
    }

.ui-stat-primary {
    --stat-color: #007bff;
    border-left-color: #007bff;
}

.ui-stat-success {
    --stat-color: #28a745;
    border-left-color: #28a745;
}

.ui-stat-warning {
    --stat-color: #ffc107;
    border-left-color: #ffc107;
}

.ui-stat-danger {
    --stat-color: #dc3545;
    border-left-color: #dc3545;
}

.ui-stat-info {
    --stat-color: #17a2b8;
    border-left-color: #17a2b8;
}

.ui-stat-secondary {
    --stat-color: #6c757d;
    border-left-color: #6c757d;
}

.ui-stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.ui-stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    background: var(--stat-color);
    opacity: 0.9;
}

.ui-stat-content {
    flex: 1;
}

.ui-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.2;
}

.ui-stat-label {
    color: #6c757d;
    font-size: 0.875rem;
    font-weight: 500;
    margin-top: 0.25rem;
}

/* Card Styles */
.ui-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
    transition: box-shadow 0.3s ease;
}

    .ui-card:hover {
        box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    }

.ui-card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 12px 12px 0 0;
}

.ui-card-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #495057;
}

.ui-card-body {
    padding: 1.5rem;
}

.ui-card-form {
    border: 1px solid #dee2e6;
}

    .ui-card-form .ui-card-title {
        background: linear-gradient(135deg, #f1f3f4 0%, #ffffff 100%);
        border-bottom: 2px solid #e9ecef;
        font-weight: 600;
        color: #495057;
        padding: 1rem 1.5rem;
        margin: 0;
    }

.ui-card-filters {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 1px solid #dee2e6;
}

.ui-card-table {
    overflow: hidden;
}

.ui-card-actions {
    background: linear-gradient(135deg, #fff3cd 0%, #ffffff 100%);
    border: 1px solid #ffeaa7;
}

.ui-card-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #ffffff 100%);
    border-left: 4px solid #17a2b8;
}

.ui-card-success {
    background: linear-gradient(135deg, #d4edda 0%, #ffffff 100%);
    border-left: 4px solid #28a745;
}

.ui-card-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffffff 100%);
    border-left: 4px solid #ffc107;
}

/* Button Styles */
.ui-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.6rem 1.2rem;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.5;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    position: relative;
    overflow: hidden;
}

    .ui-btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    }

    .ui-btn:active {
        transform: translateY(0);
    }

    .ui-btn:disabled {
        opacity: 0.6;
        cursor: not-allowed;
        transform: none !important;
    }

.ui-btn-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border-color: #007bff;
    color: white;
}

.ui-btn-success {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    border-color: #28a745;
    color: white;
}

.ui-btn-warning {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    border-color: #ffc107;
    color: #212529;
}

.ui-btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #bd2130 100%);
    border-color: #dc3545;
    color: white;
}

.ui-btn-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    border-color: #17a2b8;
    color: white;
}

.ui-btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #545b62 100%);
    border-color: #6c757d;
    color: white;
}

.ui-btn-outline-primary {
    background: transparent;
    border-color: #007bff;
    color: #007bff;
}

    .ui-btn-outline-primary:hover {
        background: #007bff;
        color: white;
    }

.ui-btn-outline-secondary {
    background: transparent;
    border-color: #6c757d;
    color: #6c757d;
}

    .ui-btn-outline-secondary:hover {
        background: #6c757d;
        color: white;
    }

.ui-btn-outline-success {
    background: transparent;
    border-color: #28a745;
    color: #28a745;
}

    .ui-btn-outline-success:hover {
        background: #28a745;
        color: white;
    }

.ui-btn-outline-warning {
    background: transparent;
    border-color: #ffc107;
    color: #ffc107;
}

    .ui-btn-outline-warning:hover {
        background: #ffc107;
        color: #212529;
    }

.ui-btn-outline-danger {
    background: transparent;
    border-color: #dc3545;
    color: #dc3545;
}

    .ui-btn-outline-danger:hover {
        background: #dc3545;
        color: white;
    }

.ui-btn-outline-info {
    background: transparent;
    border-color: #17a2b8;
    color: #17a2b8;
}

    .ui-btn-outline-info:hover {
        background: #17a2b8;
        color: white;
    }

.ui-btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8125rem;
}

/* Input Styles */
.ui-input {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.5;
    color: #495057;
    background: #fff;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.2s ease-in-out;
}

    .ui-input:focus {
        border-color: #007bff;
        outline: 0;
        box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
        background: #ffffff;
    }

    .ui-input:hover:not(:focus) {
        border-color: #ced4da;
    }

.ui-label {
    display: inline-block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #495057;
}

/* Table Styles */
.ui-table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.ui-table {
    width: 100%;
    margin-bottom: 0;
    color: #495057;
    border-collapse: collapse;
}

    .ui-table th,
    .ui-table td {
        padding: 1rem 0.75rem;
        border-bottom: 1px solid #e9ecef;
        vertical-align: middle;
    }

    .ui-table th {
        background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
        font-weight: 600;
        color: #495057;
        border-bottom: 2px solid #dee2e6;
        position: sticky;
        top: 0;
        z-index: 10;
    }

    .ui-table tbody tr {
        transition: background-color 0.2s ease;
    }

        .ui-table tbody tr:hover {
            background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
        }

.table-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffffff 100%) !important;
}

.table-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #ffffff 100%) !important;
}

.table-success {
    background: linear-gradient(135deg, #d4edda 0%, #ffffff 100%) !important;
}

/* Progress Bars */
.ui-progress-item {
    margin-bottom: 1rem;
}

.ui-progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.ui-progress-bar {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.ui-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}

/* Metrics */
.ui-metric {
    text-align: center;
    padding: 1rem;
    border-radius: 8px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 1px solid #e9ecef;
}

.ui-metric-label {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.ui-metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #495057;
}

/* Pagination */
.ui-pagination-nav {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    padding: 1rem;
    border-top: 1px solid #e9ecef;
}

.ui-pagination {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.25rem;
}

.ui-page-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0.5rem;
    border: 1px solid #e9ecef;
    background: white;
    color: #495057;
    text-decoration: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

    .ui-page-btn:hover:not(:disabled) {
        background: #e9ecef;
        border-color: #ced4da;
        transform: translateY(-1px);
    }

    .ui-page-btn.active {
        background: #007bff;
        border-color: #007bff;
        color: white;
        font-weight: 600;
    }

    .ui-page-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

.ui-page-dots {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    color: #6c757d;
}

/* Modal Styles */
.ui-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1050;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

    .ui-modal.show {
        display: flex;
    }

.ui-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
}

.ui-modal-dialog {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: auto;
    pointer-events: auto;
}

.ui-modal-fullscreen .ui-modal-dialog {
    max-width: 95%;
    width: 1200px;
}

.ui-modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.ui-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.ui-modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #495057;
}

.ui-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

    .ui-modal-close:hover {
        background: #f8f9fa;
        color: #495057;
    }

.ui-modal-body {
    padding: 1.5rem;
    max-height: 70vh;
    overflow-y: auto;
}

.ui-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e9ecef;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Section Titles */
.ui-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
}

/* Info Box */
.ui-info-box {
    background: linear-gradient(135deg, #e3f2fd 0%, #ffffff 100%);
    border: 1px solid #bbdefb;
    border-radius: 8px;
    padding: 1rem;
    color: #1976d2;
    font-size: 0.875rem;
}

/* Validation Messages */
.ui-validation-center {
    background: linear-gradient(135deg, #f8d7da 0%, #ffffff 100%);
    color: #721c24;
    padding: 0.75rem 1rem;
    border: 1px solid #f1aeb5;
    border-radius: 8px;
    position: relative;
    margin-bottom: 1rem;
}

.ui-validation-close {
    position: absolute;
    top: 0.5rem;
    right: 1rem;
    cursor: pointer;
    font-size: 1.25rem;
    color: #721c24;
    text-decoration: none;
}

    .ui-validation-close:hover {
        opacity: 0.7;
    }

/* Container */
.ui-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ui-page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .ui-page-actions {
        justify-content: center;
    }

    .ui-stat-card {
        padding: 1rem;
    }

    .ui-stat-value {
        font-size: 1.5rem;
    }

    .ui-modal-dialog {
        margin: 0.5rem;
    }

    .ui-modal-fullscreen .ui-modal-dialog {
        max-width: 95%;
        margin: 0.5rem;
    }

    .ui-table {
        font-size: 0.875rem;
    }

        .ui-table th,
        .ui-table td {
            padding: 0.5rem;
        }
}

/* Badge Colors */
.bg-success {
    background-color: #28a745 !important;
}

.bg-warning {
    background-color: #ffc107 !important;
}

.bg-danger {
    background-color: #dc3545 !important;
}

.bg-info {
    background-color: #17a2b8 !important;
}

.bg-primary {
    background-color: #007bff !important;
}

.bg-secondary {
    background-color: #6c757d !important;
}

/* Text Colors */
.text-success {
    color: #28a745 !important;
}

.text-warning {
    color: #ffc107 !important;
}

.text-danger {
    color: #dc3545 !important;
}

.text-info {
    color: #17a2b8 !important;
}

.text-primary {
    color: #007bff !important;
}

.text-secondary {
    color: #6c757d !important;
}

.text-muted {
    color: #6c757d !important;
}

/* Utility Classes */
.fw-bold {
    font-weight: 700 !important;
}

.fw-semibold {
    font-weight: 600 !important;
}

.fw-normal {
    font-weight: 400 !important;
}

.text-center {
    text-align: center !important;
}

.text-end {
    text-align: end !important;
}

.d-flex {
    display: flex !important;
}

.justify-content-between {
    justify-content: space-between !important;
}

.justify-content-center {
    justify-content: center !important;
}

.align-items-center {
    align-items: center !important;
}

.flex-fill {
    flex: 1 1 auto !important;
}

.mb-1 {
    margin-bottom: 0.25rem !important;
}

.mb-2 {
    margin-bottom: 0.5rem !important;
}

.mb-3 {
    margin-bottom: 1rem !important;
}

.mb-4 {
    margin-bottom: 1.5rem !important;
}

.me-1 {
    margin-right: 0.25rem !important;
}

.me-2 {
    margin-right: 0.5rem !important;
}

.ms-1 {
    margin-left: 0.25rem !important;
}

.ms-2 {
    margin-left: 0.5rem !important;
}

.gap-2 {
    gap: 0.5rem !important;
}

.gap-3 {
    gap: 1rem !important;
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
