/* General Body Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    text-align: center;
    background-color: #f4f7f6;
    color: #333;
    margin: 0;
    padding-bottom: 70px; /* Space for fixed footer */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    background-color: #2c3e50;
    padding: 20px 0;
    color: #ecf0f1;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.countdown-title {
    margin: 0;
    font-size: 2.5em;
    font-weight: 700;
}

main {
    flex-grow: 1;
    padding: 20px;
    max-width: 1200px;
    margin: 20px auto;
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

h2 {
    color: #34495e;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
    margin-bottom: 25px;
    font-size: 1.8em;
}

h3 {
    color: #555;
    font-size: 1.4em;
    margin-top: 30px;
}

/* Countdown Display */
.countdown-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.countdown-segment {
    background-color: #e8f0f2;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    min-width: 120px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.countdown-time {
    font-size: 3.5em;
    font-weight: bold;
    color: #2980b9;
    line-height: 1.1;
}

.countdown-label {
    font-size: 0.9em;
    color: #7f8c8d;
    text-transform: uppercase;
    margin-top: 5px;
    letter-spacing: 1px;
}

.message {
    font-size: 1.2em;
    font-weight: bold;
    color: #e74c3c;
    margin-top: -15px;
    margin-bottom: 20px;
}

/* Controls Panel */
.controls-panel {
    background-color: #f9f9f9;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.deadline-input-group {
    margin-bottom: 20px;
}

.deadline-input-group label,
.notification-time-input label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}

input[type="datetime-local"],
input[type="number"] {
    padding: 12px;
    font-size: 1.1em;
    border: 1px solid #ccc;
    border-radius: 6px;
    width: calc(100% - 24px); /* Account for padding */
    max-width: 300px;
    box-sizing: border-box;
    margin-bottom: 15px;
    transition: border-color 0.3s ease;
}

input[type="datetime-local"]:focus,
input[type="number"]:focus {
    border-color: #3498db;
    outline: none;
}

.countdown-actions button {
    padding: 12px 25px;
    font-size: 1.1em;
    background-color: #2ecc71; /* Green for start/add */
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin: 5px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

#stop-current-countdown {
    background-color: #e74c3c; /* Red for stop */
}

#reset-current-countdown {
    background-color: #f39c12; /* Orange for reset */
}

.countdown-actions button:hover {
    background-color: #27ae60;
    transform: translateY(-2px);
}

#stop-current-countdown:hover {
    background-color: #c0392b;
}

#reset-current-countdown:hover {
    background-color: #e67e22;
}

/* Notification Settings */
.notification-settings {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px dashed #ddd;
}

.notification-settings label {
    font-size: 1.1em;
    display: inline-flex; /* Align checkbox and text */
    align-items: center;
    margin-right: 20px;
    cursor: pointer;
}

#enable-notifications {
    margin-right: 8px;
    transform: scale(1.2);
}

.notification-time-input {
    display: inline-block;
    vertical-align: middle;
}

/* Saved Countdowns */
.saved-countdowns {
    margin-top: 40px;
}

#countdowns-list {
    list-style: none;
    padding: 0;
    max-width: 600px;
    margin: 20px auto;
    background-color: #f0f8ff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

#countdowns-list li {
    padding: 15px;
    border-bottom: 1px solid #eef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1em;
    color: #444;
}

#countdowns-list li:last-child {
    border-bottom: none;
}

#countdowns-list li span {
    flex-grow: 1;
    text-align: left;
    margin-right: 10px;
}

#countdowns-list li button {
    padding: 8px 15px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    margin-left: 10px;
    transition: background-color 0.3s ease;
}

#countdowns-list li button.delete {
    background-color: #e74c3c;
}

#countdowns-list li button:hover {
    background-color: #2980b9;
}

#countdowns-list li button.delete:hover {
    background-color: #c0392b;
}

/* Social Media */
.social-media-container {
    margin: 25px auto;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.social-media-link {
    font-size: 1.8em;
    color: #34495e;
    transition: color 0.3s ease, transform 0.2s ease;
}

.social-media-link:hover {
    color: #2980b9;
    transform: translateY(-3px);
}

/* Footer */
.footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 15px;
    width: 100%;
    margin-top: auto; /* Pushes footer to bottom */
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.2);
}

.footer p {
    margin: 0;
    font-size: 0.9em;
}

/* Media Queries for Responsiveness */
@media (max-width: 768px) {
    .countdown-title {
        font-size: 2em;
    }
    .countdown-segment {
        min-width: 100px;
        padding: 10px 15px;
    }
    .countdown-time {
        font-size: 2.5em;
    }
    .countdown-label {
        font-size: 0.8em;
    }
    .countdown-actions button {
        display: block;
        width: calc(100% - 10px);
        margin: 10px auto;
    }
    input[type="datetime-local"],
    input[type="number"] {
        max-width: 90%;
    }
    .notification-settings {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .notification-settings label,
    .notification-time-input {
        margin-bottom: 10px;
    }
}

@media (max-width: 480px) {
    .countdown-title {
        font-size: 1.8em;
    }
    .countdown-segment {
        width: 100%;
        margin: 5px 0;
    }
    .countdown-time {
        font-size: 2em;
    }
    .social-media-link {
        font-size: 1.5em;
    }
    main {
        margin: 10px;
        padding: 15px;
    }
}