/* Additional styles for the admin app */
/* This file can be used to extend or override the styles in index.html */

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.05);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: rgba(46, 125, 50, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(46, 125, 50, 0.5);
}

/* Animation for content transitions */
.content-area > div {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive table adjustments */
@media (max-width: 768px) {
    .table {
        font-size: 11px;
    }
    
    .table th, 
    .table td {
        padding: 6px 4px;
    }
    
    .status-badge {
        padding: 2px 6px;
        font-size: 9px;
    }
}

/* Chart container enhancements */
.chart-container {
    position: relative;
    overflow: hidden;
}

.chart-container canvas {
    max-height: 250px;
    width: 100% !important;
    height: 100% !important;
}

.chart-wrapper {
    position: relative;
    height: 199px;
    width: 100%;
}

/* Form enhancements */
.form-control:focus {
    outline: none;
    border-color: #2e7d32;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.2);
}

/* Button hover effects */
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.btn:active {
    transform: translateY(0);
}

/* Card hover effects */
.stat-card, .table-container, .chart-container {
    transition: all 0.3s ease;
}

.stat-card:hover, .table-container:hover, .chart-container:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

/* Chart legend adjustments */
.chart-container .chartjs-legend {
    margin-top: 20px;
}

.chart-container .chartjs-legend ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.chart-container .chartjs-legend li {
    display: flex;
    align-items: center;
    margin: 0 10px 5px 0;
    font-size: 12px;
}

.chart-container .chartjs-legend li span {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 5px;
    border-radius: 2px;
}

/* Compact layout adjustments */
.stats-container {
    gap: 15px;
}

.stat-card {
    padding-left: 12px;
    padding-right: 12px;
    padding-top: 12px;
    padding-bottom: 10px;
}

.chart-header {
    margin-bottom: 10px;
}

.table th, .table td {
    padding: 10px;
}

.content-header {
    margin-bottom: 10px;
}

/* Fix for chart container overflow */
.content-area {
    overflow-y: auto;
    max-height: calc(100vh - 120px);
}

/* Additional styles for editable table cells */
.form-control-sm {
    padding: 4px 6px;
    font-size: 11px;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.1);
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-dark);
    width: 100%;
    box-sizing: border-box;
}

.form-control-sm:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 2px rgba(46, 125, 50, 0.2);
}

select.form-control-sm {
    height: 24px;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 16px;
    padding-right: 24px;
    appearance: none;
}

/* Spinner styles */
.spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-text {
    display: inline;
}

.btn-loading .btn-text {
    display: none;
}

.btn-loading .spinner {
    display: inline-block;
}

/* Modal styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-dialog {
    background: white;
    border-radius: 15px;
    width: 95%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    z-index: 1001;
    display: flex;
    flex-direction: column;
}

.modal-content {
    border-radius: 15px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.8);
}

.modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
}

.btn-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--dark-gray);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.btn-close:hover {
    color: var(--darker-gray);
    background: rgba(0,0,0,0.05);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid rgba(0,0,0,0.05);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: rgba(255, 255, 255, 0.8);
}

.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
    font-weight: 500;
    color: var(--darker-gray);
}

.form-control {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.1);
    background: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    color: var(--text-dark);
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.2);
}

select.form-control {
    height: 38px;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 16px;
    padding-right: 36px;
    appearance: none;
}

/* Form grid for horizontal layout */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Pagination styles */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 15px;
    gap: 10px;
}

.pagination-info {
    font-size: 12px;
    color: var(--darker-gray);
}

.btn-sm:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-sm:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Responsive adjustments for modal */
@media (max-width: 768px) {
    .modal-dialog {
        width: 95%;
        max-width: 95%;
        max-height: 95vh;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}
