/* General Body Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f0f2f5; /* Light gray background */
    color: #333;
    line-height: 1.6;
}

/* Container for Centering Content */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
header {
    background-color: #4CAF50; /* Green primary color */
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
}

header h1 {
    margin: 0;
    font-size: 2.5em;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

header nav {
    margin-top: 10px;
}

header nav a {
    color: white;
    text-decoration: none;
    margin: 0 15px;
    font-weight: bold;
    transition: color 0.3s ease;
}

header nav a:hover {
    color: #c8e6c9; /* Lighter green on hover */
}

/* Main Content Area */
main {
    padding: 20px 0;
}

/* Headings within Main */
main h2 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 2em;
    position: relative;
    padding-bottom: 10px;
}

main h2::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: #4CAF50;
    border-radius: 5px;
}

/* Sorteo Grid Layout */
.sorteo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

/* Sorteo Card Styles */
.sorteo-card {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 25px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.sorteo-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.sorteo-card h3 {
    color: #333;
    font-size: 1.8em;
    margin-top: 0;
    margin-bottom: 15px;
    min-height: 50px; /* Ensure consistent height for titles */
}

.sorteo-card p {
    color: #666;
    font-size: 1em;
    margin-bottom: 15px;
    flex-grow: 1; /* Allows description to take available space */
}

.sorteo-card .fecha-limite {
    font-weight: bold;
    color: #e67e22; /* Orange for emphasis */
    margin-bottom: 20px;
}

/* Button Styles */
.btn {
    display: inline-block;
    background-color: #4CAF50;
    color: white;
    padding: 12px 25px;
    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: 1em;
}

.btn:hover {
    background-color: #45a049; /* Darker green on hover */
    transform: translateY(-2px);
}

.btn-primary {
    background-color: #007bff; /* Blue for primary actions */
}

.btn-primary:hover {
    background-color: #0056b3;
}

/* No Sorteos Message */
.no-sorteos {
    text-align: center;
    font-size: 1.2em;
    color: #777;
    padding: 50px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Form Specific Styles for registro.php */
.form-page {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sorteo-detail-card {
    background-color: #e8f5e9; /* Light green background */
    border: 1px solid #c8e6c9;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 30px;
    text-align: center;
    width: 100%;
    max-width: 600px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.sorteo-detail-card h2 {
    color: #2e7d32; /* Darker green */
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 2em;
}

.sorteo-detail-card p {
    color: #388e3c; /* Green text */
    margin-bottom: 5px;
}

.sorteo-detail-card .fecha-limite {
    font-weight: bold;
    color: #d35400; /* Darker orange */
}

.sorteo-form {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    padding: 30px;
    width: 100%;
    max-width: 600px; /* Max width for forms */
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}

.form-group input[type="text"],
.form-group input[type="tel"],
.form-group input[type="email"],
.form-group input[type="file"] {
    width: calc(100% - 20px); /* Adjust for padding */
    padding: 12px 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="tel"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="file"]:focus {
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
    outline: none;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #888;
    font-size: 0.9em;
}

/* Messages (Error/Success) */
.message {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-size: 1em;
    width: 100%;
    max-width: 600px;
    text-align: center;
}

.message.error {
    background-color: #ffe0b2; /* Light orange for errors */
    color: #e65100; /* Dark orange text */
    border: 1px solid #ffcc80;
}

.message.success {
    background-color: #e8f5e9; /* Light green for success */
    color: #2e7d32; /* Dark green text */
    border: 1px solid #c8e6c9;
}

/* Footer Styles */
footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
}

footer p {
    margin: 0;
    font-size: 0.9em;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }

    header nav a {
        margin: 0 10px;
    }

    .sorteo-grid {
        grid-template-columns: 1fr; /* Single column on small screens */
    }

    .sorteo-card, .sorteo-form, .sorteo-detail-card, .message {
        margin-left: 10px;
        margin-right: 10px;
    }
}