/* General Body Styles */
body {
    font-family: 'Roboto', sans-serif; /* Modern, clean font */
    margin: 0;
    padding: 0;
    background-color: #eef2f7; /* Lighter, subtle background */
    color: #333;
    line-height: 1.6;
}

/* Admin Header */
.admin-header {
    background-color: #2c3e50; /* Dark blue/gray, professional */
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.admin-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header h1 {
    margin: 0;
    font-size: 1.8em;
}

.admin-nav a {
    color: white;
    text-decoration: none;
    margin-left: 20px;
    padding: 8px 12px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.admin-nav a:hover,
.admin-nav a.active {
    background-color: #34495e; /* Slightly lighter shade for hover/active */
}

.admin-nav .btn-logout {
    background-color: #e74c3c; /* Red for logout */
    padding: 8px 15px;
    font-weight: bold;
}

.admin-nav .btn-logout:hover {
    background-color: #c0392b;
}

/* Main Content Area */
.admin-content {
    padding-top: 30px;
    padding-bottom: 50px;
}

.admin-content h2 {
    color: #2c3e50;
    text-align: center;
    margin-bottom: 30px;
    font-size: 2.2em;
    position: relative;
    padding-bottom: 10px;
}

.admin-content h2::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background-color: #3498db; /* Blue accent */
    border-radius: 5px;
}

/* Dashboard Stats */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.stat-card {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 25px;
    text-align: center;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card h3 {
    color: #3498db; /* Blue accent */
    font-size: 1.5em;
    margin-top: 0;
    margin-bottom: 10px;
}

.stat-card p {
    font-size: 2.5em;
    font-weight: bold;
    color: #2c3e50;
    margin: 0;
}

/* Admin Actions (Dashboard) */
.admin-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.action-card {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 25px;
    text-align: center;
    transition: transform 0.3s ease;
}

.action-card:hover {
    transform: translateY(-5px);
}

.action-card h3 {
    color: #2c3e50;
    font-size: 1.6em;
    margin-top: 0;
    margin-bottom: 15px;
}

.btn-action {
    background-color: #2ecc71; /* Green for actions */
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease;
    display: inline-block;
    margin-top: 15px;
}

.btn-action:hover {
    background-color: #27ae60;
}

/* Form Styles (Login, Create Sorteo, Add Admin) */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(to right, #3498db, #2c3e50); /* Gradient background */
}

.login-container, .form-section {
    background-color: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 450px;
    text-align: center;
}

.login-container h2, .form-section h3 {
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 2em;
}

.admin-form .form-group {
    margin-bottom: 20px;
    text-align: left;
}

.admin-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}

.admin-form input[type="text"],
.admin-form input[type="password"],
.admin-form input[type="email"],
.admin-form input[type="date"],
.admin-form textarea {
    width: calc(100% - 22px); /* Adjust for padding and border */
    padding: 12px 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.admin-form input[type="text"]:focus,
.admin-form input[type="password"]:focus,
.admin-form input[type="email"]:focus,
.admin-form input[type="date"]:focus,
.admin-form textarea:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
    outline: none;
}

.admin-form textarea {
    resize: vertical;
    min-height: 80px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    margin-top: 15px;
}

.checkbox-group input[type="checkbox"] {
    margin-right: 10px;
    transform: scale(1.2);
}

/* Table Styles */
.table-section {
    background-color: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-top: 30px;
    overflow-x: auto; /* For responsive tables */
}

.table-section h3 {
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.8em;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.data-table th, .data-table td {
    padding: 12px 15px;
    border: 1px solid #eee;
    text-align: left;
    vertical-align: middle;
}

.data-table th {
    background-color: #f8f8f8;
    font-weight: bold;
    color: #555;
    white-space: nowrap; /* Prevent headers from wrapping too much */
}

.data-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.data-table tbody tr:hover {
    background-color: #f1f1f1;
}

/* Status Indicators */
.status-indicator {
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: bold;
    text-transform: uppercase;
    display: inline-block;
    margin-right: 5px;
}

.status-active {
    background-color: #e6ffe6; /* Light green */
    color: #28a745; /* Dark green */
    border: 1px solid #c3e6cb;
}

.status-inactive {
    background-color: #ffebe6; /* Light red */
    color: #dc3545; /* Dark red */
    border: 1px solid #f5c6cb;
}

/* Action Buttons (Table and General) */
.btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease;
    border: none;
    cursor: pointer;
    font-size: 0.95em;
    margin: 5px; /* Spacing between buttons */
    white-space: nowrap; /* Prevent button text from wrapping */
}

.btn-sm {
    padding: 8px 12px;
    font-size: 0.8em;
}

.btn-lg {
    padding: 15px 30px;
    font-size: 1.1em;
}

.btn-primary {
    background-color: #3498db; /* Blue */
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #95a5a6; /* Gray */
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
    transform: translateY(-1px);
}

.btn-success {
    background-color: #2ecc71; /* Green */
    color: white;
}

.btn-success:hover {
    background-color: #27ae60;
    transform: translateY(-1px);
}

.btn-warning {
    background-color: #f39c12; /* Orange */
    color: white;
}

.btn-warning:hover {
    background-color: #e67e22;
    transform: translateY(-1px);
}

.btn-info {
    background-color: #1abc9c; /* Teal */
    color: white;
}

.btn-info:hover {
    background-color: #16a085;
    transform: translateY(-1px);
}

.btn-danger {
    background-color: #e74c3c; /* Red */
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
    transform: translateY(-1px);
}

.btn-disabled {
    background-color: #cccccc;
    color: #666666;
    cursor: not-allowed;
    opacity: 0.8;
    pointer-events: none; /* Disable click events */
}

.btn-download {
    background-color: #6c757d;
    color: white;
}

.btn-download:hover {
    background-color: #5a6268;
}

/* Messages (Error/Success) */
.message {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-size: 1em;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.message.error {
    background-color: #fbecec; /* Light red */
    color: #d9534f; /* Darker red */
    border: 1px solid #ebcccc;
}

.message.success {
    background-color: #eaf7ed; /* Light green */
    color: #5cb85c; /* Darker green */
    border: 1px solid #d4edda;
}

/* Action Buttons Container */
.action-buttons-top {
    margin-bottom: 20px;
    text-align: right;
}

.action-buttons-top .btn {
    margin-left: 10px;
}

/* Sorteo Details in admin/sorteo_info.php */
.sorteo-detail-card {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.sorteo-detail-card p {
    margin-bottom: 10px;
    font-size: 1.1em;
}

.sorteo-detail-card p strong {
    color: #2c3e50;
}

.winner-name {
    font-weight: bold;
    color: #28a745; /* Green for winner */
}

/* Info card for select winner page */
.info-card {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
    margin-bottom: 30px;
}

.info-card h3 {
    color: #2c3e50;
    font-size: 1.8em;
    margin-top: 0;
    margin-bottom: 15px;
}

.info-card p {
    font-size: 1.1em;
    margin-bottom: 10px;
}

.info-card .warning-text {
    color: #e74c3c;
    font-weight: bold;
    font-size: 1.1em;
}

.info-card.winner-selected {
    background-color: #d4edda; /* Lighter green for selected winner state */
    border: 1px solid #28a745;
}


/* Back Link */
.back-link {
    text-align: center;
    margin-top: 20px;
}

.back-link a {
    color: #3498db;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.back-link a:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* Admin Footer */
.admin-footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 15px 0;
    margin-top: 40px;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.2);
}

.admin-footer p {
    margin: 0;
    font-size: 0.9em;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .admin-header .container {
        flex-direction: column;
        text-align: center;
    }
    .admin-nav {
        margin-top: 15px;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }
    .admin-nav a {
        margin: 5px 10px;
    }
    .dashboard-stats, .admin-actions {
        grid-template-columns: 1fr;
    }
    .data-table th, .data-table td {
        padding: 8px 10px;
        font-size: 0.9em;
    }
    .data-table .actions .btn {
        margin: 2px;
        padding: 6px 10px;
    }
    .login-container, .form-section, .table-section, .sorteo-detail-card, .info-card {
        padding: 20px;
        margin-left: 10px;
        margin-right: 10px;
    }
    .admin-form input[type="text"],
    .admin-form input[type="password"],
    .admin-form input[type="email"],
    .admin-form input[type="date"],
    .admin-form textarea {
        width: calc(100% - 20px); /* Adjust for smaller screens */
    }
}