/**
 * Digital Governance Scorecard - Custom Styles
 */

/* Root Variables */
:root {
    --primary-color: #0d6efd;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --dark-color: #212529;
    --light-color: #f8f9fa;
}

/* Body */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 0 !important;
}

.hero-section h1 {
    color: white;
}

.hero-section .lead {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Cards */
.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
}

.card-header {
    border-radius: 15px 15px 0 0 !important;
    padding: 1.5rem;
}

.card-body {
    padding: 2rem;
}

/* Section Headers */
.section-header h5 {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.section-header hr {
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    border-top: 2px solid;
    opacity: 0.2;
}

/* Pillar Sections */
.pillar-section {
    background-color: #f8f9fa;
    transition: all 0.3s ease;
}

.pillar-section:hover {
    background-color: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.pillar-section h6 {
    color: #333;
    font-size: 1.1rem;
}

/* Rating Group */
.rating-group .btn-group {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.rating-group .btn {
    font-weight: 600;
    padding: 0.75rem 1rem;
}

.rating-group .btn-check:checked + .btn {
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
    transform: scale(1.05);
}

/* Form Controls */
.form-select,
.form-control {
    border-radius: 8px;
    border: 1px solid #ced4da;
    padding: 0.6rem 0.75rem;
}

.form-select:focus,
.form-control:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

/* Buttons */
.btn {
    border-radius: 8px;
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-lg {
    padding: 0.8rem 2rem;
    font-size: 1.1rem;
}

/* Navbar */
.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-size: 1.3rem;
    font-weight: 700;
}

/* Footer */
footer {
    margin-top: 4rem;
}

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

.form-container {
    animation: fadeIn 0.5s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-section .lead {
        font-size: 1rem;
    }
    
    .card-body {
        padding: 1.5rem;
    }
    
    .rating-group .btn-group {
        flex-wrap: wrap;
    }
    
    .rating-group .btn {
        flex: 1 0 18%;
        min-width: 60px;
    }
}

@media (max-width: 576px) {
    .hero-section {
        padding: 2rem 0 !important;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .pillar-section {
        padding: 1rem !important;
    }
}

/* Text Colors */
.text-primary-custom {
    color: #667eea !important;
}

.text-success-custom {
    color: #4caf50 !important;
}

/* Badges */
.badge-rating {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

/* Loading Spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Character Counter */
.char-counter {
    font-size: 0.85rem;
    color: #6c757d;
    text-align: right;
    margin-top: 0.25rem;
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Print Styles */
@media print {
    .navbar,
    .hero-section,
    footer,
    .btn {
        display: none !important;
    }
    
    .card {
        page-break-inside: avoid;
    }
}

/* Accessibility */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* Skip to Content Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #0d6efd;
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* Form Validation Styles */
.was-validated .form-control:valid,
.was-validated .form-select:valid {
    border-color: #198754;
}

.was-validated .form-control:invalid,
.was-validated .form-select:invalid {
    border-color: #dc3545;
}

/* Tooltip Customization */
.tooltip-inner {
    background-color: #333;
    color: white;
    border-radius: 6px;
    padding: 0.5rem 1rem;
}

/* SweetAlert2 Custom Styles */
.swal2-popup {
    border-radius: 15px;
}

.swal2-title {
    font-weight: 700;
}

/* DataTables Custom Styles */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 1rem;
}

.dataTables_wrapper .dataTables_paginate {
    margin-top: 1rem;
}

/* Star Rating Alternative (if needed) */
.star-rating {
    display: inline-flex;
    gap: 0.25rem;
}

.star-rating input[type="radio"] {
    display: none;
}

.star-rating label {
    cursor: pointer;
    font-size: 1.5rem;
    color: #ddd;
    transition: color 0.2s;
}

.star-rating label:hover,
.star-rating label:hover ~ label,
.star-rating input[type="radio"]:checked ~ label {
    color: #ffc107;
}

/* Progress Indicator */
.progress-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.progress-step {
    flex: 1;
    text-align: center;
    padding: 1rem;
    background: #e9ecef;
    position: relative;
}

.progress-step.active {
    background: #0d6efd;
    color: white;
}

.progress-step:not(:last-child)::after {
    content: '→';
    position: absolute;
    right: -1rem;
    top: 50%;
    transform: translateY(-50%);
}

/* Mobile Navigation */
@media (max-width: 991px) {
    .navbar-collapse {
        background: #0d6efd;
        padding: 1rem;
        border-radius: 8px;
        margin-top: 1rem;
    }
}
