/* Fee Casting Manager - Stylesheet
   (c) 2025 Cristian Marinescu
   ================================ */

/* Variables */
:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;
    --dark-color: #1f2937;
    --gray-color: #6b7280;
    --light-gray: #f3f4f6;
    --border-color: #e5e7eb;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--dark-color);
    background: var(--light-gray);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--gray-color); }
.text-success { color: var(--success-color); }
.text-warning { color: var(--warning-color); }
.text-danger { color: var(--danger-color); }
.text-info { color: var(--info-color); }

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loader {
    width: 50px;
    height: 50px;
    border: 3px solid var(--light-gray);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
    overflow: hidden;
}

.login-header {
    background: var(--light-gray);
    padding: 30px;
    text-align: center;
}

.login-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.login-header h1 {
    color: var(--dark-color);
    margin-bottom: 10px;
    font-size: 1.75rem;
}

.login-header p {
    color: var(--gray-color);
    font-size: 0.95rem;
}

.login-form {
    padding: 30px;
}

.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-color);
}

.input-group input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.btn-login {
    width: 100%;
    padding: 12px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-login:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.login-footer {
    padding: 20px;
    text-align: center;
    background: var(--light-gray);
    border-top: 1px solid var(--border-color);
    font-size: 0.875rem;
    color: var(--gray-color);
}

/* Main Layout */
.main-header {
    background: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left h1 {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-left p {
    color: var(--gray-color);
    margin-top: 5px;
}

.btn-logout {
    padding: 8px 16px;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-logout:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    opacity: 0.8;
}

.stat-content h3 {
    font-size: 0.875rem;
    color: var(--gray-color);
    font-weight: 500;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
}

.stat-info {
    font-size: 0.875rem;
    color: var(--gray-color);
    margin-top: 5px;
}

/* Person Stats */
.person-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.person-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.person-card h4 {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.person-stats-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
}

/* Actions Bar - Design compact */
.actions-bar {
    background: white;
    border-radius: 10px;
    padding: 15px 20px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.filters-container {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.filters-main {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.search-input {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
}

.date-range-compact {
    display: flex;
    align-items: center;
    gap: 5px;
    background: var(--light-gray);
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.date-separator {
    color: var(--gray-color);
    font-size: 12px;
}

.filter-date {
    padding: 4px 8px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 13px;
    background: white;
    width: 110px;
}

.filter-select-compact {
    padding: 7px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    min-width: 90px;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.btn-clear-filters {
    padding: 7px 10px;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-clear-filters:hover {
    background: #dc2626;
}

.actions-buttons {
    display: flex;
    gap: 10px;
}

/* Hover effects */
.search-input:focus,
.filter-date:focus,
.filter-select-compact:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--info-color);
    color: white;
}

.btn-secondary:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-1px);
}

.btn-icon {
    padding: 6px 10px;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-icon:hover {
    background: var(--light-gray);
    border-color: var(--gray-color);
}

.btn-danger {
    color: var(--danger-color);
}

.btn-danger:hover {
    background: #fee2e2;
    border-color: var(--danger-color);
}

/* Table */
.table-container {
    background: white;
    border-radius: 10px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.projects-table {
    width: 100%;
    border-collapse: collapse;
}

.projects-table th {
    background: var(--light-gray);
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--dark-color);
    border-bottom: 1px solid var(--border-color);
}

.projects-table td {
    padding: 15px;
    border-bottom: 1px solid var(--light-gray);
}

.projects-table tbody tr:hover {
    background: #f9fafb;
}

.projects-table tbody tr:last-child td {
    border-bottom: none;
}

/* Payment Row */
.payment-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 8px 0;
    padding: 8px;
    background: var(--light-gray);
    border-radius: 6px;
}

.payment-info {
    display: flex;
    gap: 10px;
    align-items: center;
}

.payment-person {
    font-weight: 500;
    font-size: 0.875rem;
}

.payment-amount {
    font-weight: 600;
    color: var(--dark-color);
}

.status-select {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.3s;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
    border-color: #fbbf24;
}

.status-approved {
    background: #dbeafe;
    color: #1e40af;
    border-color: #60a5fa;
}

.status-paid {
    background: #d1fae5;
    color: #065f46;
    border-color: #34d399;
}

.status-rejected {
    background: #fee2e2;
    color: #991b1b;
    border-color: #f87171;
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 8px;
}

/* Modal */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s;
}

.modal {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-color);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.3s;
}

.btn-close:hover {
    background: var(--light-gray);
    color: var(--dark-color);
}

.modal-form {
    padding: 20px;
    overflow-y: auto;
}

.modal-content {
    overflow-y: auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--dark-color);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 16px;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.fee-preview {
    background: var(--light-gray);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.fee-calculation h4 {
    margin-bottom: 10px;
    color: var(--primary-color);
}

.fee-calculation p {
    margin: 5px 0;
    font-size: 0.875rem;
}

.fee-calculation hr {
    margin: 10px 0;
    border: none;
    border-top: 1px solid var(--border-color);
}

.modal-actions {
    display: flex;
    gap: 10px;
    padding-top: 10px;
}

.modal-actions button {
    flex: 1;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    transform: translateX(400px);
    transition: transform 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: var(--success-color);
}

.notification.error {
    background: var(--danger-color);
}

.notification.info {
    background: var(--info-color);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-color);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state p {
    font-size: 1.125rem;
}

.empty-state .btn {
    margin-top: 20px;
}

/* Filter Info */
.filter-info {
    background: var(--light-gray);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px 15px;
    margin-bottom: 15px;
    font-size: 14px;
    color: var(--gray-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-info i {
    color: var(--primary-color);
}

/* Import Excel Styles */
.form-control {
    width: 100%;
}

.alert-info {
    display: flex;
    align-items: start;
    gap: 10px;
}

.alert-info i {
    color: var(--info-color);
    margin-top: 2px;
}

.import-preview h4 {
    margin-bottom: 10px;
    color: var(--dark-color);
}

.import-projects-list {
    padding: 5px;
}

.import-project-item:hover {
    border-color: var(--primary-color) !important;
    box-shadow: var(--shadow);
}

/* Form Checkbox Styling */
.form-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-group label:has(input[type="checkbox"]) {
    transition: all 0.3s;
}

.form-group label:has(input[type="checkbox"]):hover {
    background: var(--border-color) !important;
}

.form-group label:has(input[type="checkbox"]:checked) {
    background: #e0e7ff !important;
    border: 1px solid var(--primary-color);
}

/* Responsive pentru design compact */
@media (max-width: 1200px) {
    .filters-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filters-main {
        flex-wrap: wrap;
    }
    
    .search-input {
        min-width: 100%;
        max-width: none;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .actions-bar {
        padding: 12px;
    }
    
    .filters-main {
        flex-direction: column;
        width: 100%;
    }
    
    .search-input,
    .date-range-compact,
    .filter-select-compact,
    .filter-select {
        width: 100%;
    }
    
    .date-range-compact {
        justify-content: space-between;
        padding: 8px 12px;
    }
    
    .filter-date {
        width: calc(50% - 10px);
    }
    
    .actions-buttons {
        width: 100%;
        flex-direction: column;
    }
    
    .actions-buttons .btn {
        width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .person-stats {
        grid-template-columns: 1fr;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .projects-table {
        min-width: 800px;
    }
    
    .payment-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .modal {
        width: 95%;
        margin: 10px;
    }
    
    .notification {
        right: 10px;
        left: 10px;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
    }
    
    .main-header,
    .actions-bar,
    .btn,
    .btn-icon,
    .status-select {
        display: none !important;
    }
    
    .table-container {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .projects-table th {
        background: #f5f5f5;
        color: black;
    }
}