/* index.css - Dashboard Styles for Redelec Portal */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 50%, #f0fdf4 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* App Structure */
.app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.header-fixed {
    padding-top: 0;
}

/* App Body */
.app-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding-top: 70px;
    min-height: calc(100vh - 70px);
    position: relative;
}

/* Main Content */
.main {
    flex: 1;
    padding: 0;
    padding-top: 90px;
    width: 100%;
}

.container-fluid {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.animated.fadeIn {
    animation: fadeIn 0.8s ease-out;
}

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

/* Cards */
.card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 1.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.card-body {
    padding: 2rem;
}

.card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.small.text-muted {
    color: #64748b;
    font-size: 0.875rem;
}

/* Chart Wrapper */
.chart-wrapper {
    position: relative;
}

.chart {
    width: 100% !important;
    height: auto !important;
}

/* Row */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -0.75rem;
}

.col-sm-5 {
    flex: 0 0 100%;
    max-width: 100%;
    padding: 0 0.75rem;
}

@media (min-width: 576px) {
    .col-sm-5 {
        flex: 0 0 41.666667%;
        max-width: 41.666667%;
    }
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1050;
    width: 100%;
    height: 100%;
    overflow: hidden;
    outline: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
}

.modal.fade {
    transition: opacity 0.15s linear;
}

.modal.show {
    display: block !important;
    opacity: 1;
}

.modal[aria-hidden="true"] {
    display: none !important;
}

.modal-dialog {
    position: relative;
    width: auto;
    margin: 1.75rem auto;
    max-width: 600px;
    transform: translateY(0);
    transition: transform 0.3s ease-out;
}

.modal.fade .modal-dialog {
    transform: translateY(-50px);
}

.modal.show .modal-dialog {
    transform: translateY(0);
}

.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    pointer-events: auto;
    background: white;
    background-clip: padding-box;
    border-radius: 1.5rem;
    outline: 0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
}

.modal-body {
    position: relative;
    flex: 1 1 auto;
    padding: 2rem;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 1.5rem 2rem;
    border-top: 1px solid #e5e7eb;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #475569;
    font-size: 0.875rem;
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #1e293b;
    background-color: #fff;
    background-clip: padding-box;
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    font-family: 'Outfit', sans-serif;
}

.form-control:focus {
    color: #1e293b;
    background-color: #fff;
    border-color: #10b981;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(16, 185, 129, 0.15);
}

textarea.form-control {
    resize: vertical;
}

/* Radio Buttons */
.form-check {
    position: relative;
    display: block;
    padding-left: 1.5rem;
}

.form-check-input {
    position: absolute;
    margin-top: 0.3rem;
    margin-left: -1.5rem;
}

.form-check-label {
    margin-bottom: 0;
    color: #475569;
}

.d-flex {
    display: flex !important;
}

.justify-content-around {
    justify-content: space-around !important;
}

/* Buttons */
.btn {
    display: inline-block;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.75rem;
    transition: all 0.3s ease;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
}

.btn-primary {
    background: linear-gradient(90deg, #10b981, #059669);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Utility Classes */
.mb-0 {
    margin-bottom: 0 !important;
}

.mb-3 {
    margin-bottom: 1rem !important;
}

.mt-3 {
    margin-top: 1rem !important;
}

.col-md-6 {
    flex: 0 0 100%;
    max-width: 100%;
    padding: 0 0.75rem;
}

@media (min-width: 768px) {
    .col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

.col-md-12,
.col-lg-12 {
    flex: 0 0 100%;
    max-width: 100%;
    padding: 0 0.75rem;
}

/* Hidden by default */
[style*="display: none"] {
    display: none !important;
}

/* myModal */
#myModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    display: flex;
    align-items: center;
    justify-content: center;
}

#myModal[style*="display: none"] {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .container-fluid {
        padding: 1rem;
    }
    
    .card-body {
        padding: 1.5rem;
    }
    
    .modal-dialog {
        margin: 1rem;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
}

/* Chart specific colors */
canvas {
    max-width: 100%;
}

/* Animation delays for cards */
.card:nth-child(1) {
    animation-delay: 0.1s;
}

.card:nth-child(2) {
    animation-delay: 0.2s;
}

.card:nth-child(3) {
    animation-delay: 0.3s;
}

.card:nth-child(4) {
    animation-delay: 0.4s;
}

.card:nth-child(5) {
    animation-delay: 0.5s;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Loading state */
.btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
