* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #667eea;
    background-image: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 0;
    margin: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

.container {
    width: 100%;
    height: 100vh;
    margin: 0;
    background: transparent;
    box-shadow: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 8px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo {
    height: 50px;
    width: auto;
}

.header h1 {
    font-size: 1.8em;
    font-weight: 600;
}

.date-time-section {
    text-align: right;
}

.islamic-date {
    font-size: 0.95em;
    font-weight: 500;
    margin-bottom: 4px;
    color: #ffd700;
}

.current-date {
    font-size: 0.9em;
    margin-bottom: 3px;
}

.current-time {
    font-size: 1.3em;
    font-weight: 600;
    letter-spacing: 2px;
}

.header-settings {
    display: flex;
    align-items: center;
}

.settings-icon {
    font-size: 2em;
    color: white;
    text-decoration: none;
    transition: transform 0.3s, opacity 0.3s;
    padding: 5px;
}

.settings-icon:hover {
    opacity: 0.8;
    transform: rotate(45deg);
}

/* Main Content Layout */
.main-content {
    display: flex;
    padding: 15px;
    gap: 7px;
    flex-shrink: 0;
    overflow: visible;
}

.prayer-times-section {
    flex: 1;
}

.side-panels {
    width: 450px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Prayer Table Styles */
.prayer-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: rgba(255, 255, 255, var(--panel-opacity, 0.70));
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 2px solid #2a5298;
}

.prayer-table thead {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
}

.prayer-table th {
    padding: 12px 10px;
    font-size: 1.8em;
    font-weight: 600;
    text-align: left;
}

.prayer-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

.prayer-table tbody tr:hover {
    background: #f5f5f5;
    transform: scale(1.01);
}

.prayer-table tbody tr:last-child {
    border-bottom: none;
}

.prayer-table td {
    padding: 15px 10px;
    font-size: 1.8em;
}

.prayer-name {
    font-weight: 600;
    color: #1e3c72;
}

.adhan-time {
    color: #2a5298;
    font-weight: 500;
}

.aqama-time {
    color: #27ae60;
    font-weight: 600;
}

.prayer-row.active {
    background: #e8f5e9;
    border-left: 5px solid #27ae60;
}

/* Announcements Section */
.announcements-section {
    margin: 3px 15px 15px 15px;
    background: rgba(255, 255, 255, var(--panel-opacity, 0.70));
    border-radius: 10px;
    padding: 15px 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 2px solid #2a5298;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.announcements-title {
    font-size: 1.6em;
    font-weight: 600;
    color: #1e3c72;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.announcements-content {
    font-size: 1.3em;
    color: #333;
    line-height: 1.6;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* Side Panel Styles */
.panel {
    background: rgba(255, 255, 255, var(--panel-opacity, 0.70));
    border-radius: 10px;
    padding: 14px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 2px solid #2a5298;
}

.panel h2 {
    font-size: 1.5em;
    color: #1e3c72;
    margin-bottom: 10px;
    text-align: center;
    border-bottom: 2px solid #2a5298;
    padding-bottom: 7px;
}

.panel-content {
    text-align: center;
}

/* Next Prayer Panel */
.next-prayer-name {
    font-size: 1.8em;
    font-weight: 600;
    color: #27ae60;
    margin-bottom: 7px;
}

.next-prayer-time {
    display: none;
}

.countdown {
    font-size: 2.5em;
    font-weight: 700;
    color: #e74c3c;
    font-family: 'Courier New', monospace;
    letter-spacing: 3px;
    margin-top: 7px;
}

/* Jummah Panel */
.jummah-time {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin: 10px 0;
    background: #f8f9fa;
    border-radius: 8px;
}

.jummah-label {
    font-size: 1.2em;
    font-weight: 600;
    color: #1e3c72;
}

.jummah-value {
    font-size: 1.3em;
    font-weight: 700;
    color: #27ae60;
}

/* Settings Page Styles */
.settings-container {
    max-width: 900px;
    overflow-y: auto;
    height: 100vh;
}

.back-link {
    color: white;
    text-decoration: none;
    font-size: 1.1em;
    transition: opacity 0.3s;
}

.back-link:hover {
    opacity: 0.8;
}

.settings-form {
    padding: 30px;
}

.settings-section {
    margin-bottom: 35px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 10px;
}

.settings-section h2 {
    color: #1e3c72;
    font-size: 1.5em;
    margin-bottom: 20px;
    border-bottom: 2px solid #2a5298;
    padding-bottom: 10px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 1.1em;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #2a5298;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 0.9em;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.btn-save,
.btn-cancel {
    padding: 15px 40px;
    font-size: 1.1em;
    font-weight: 600;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-save {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white;
}

.btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(39, 174, 96, 0.4);
}

.btn-cancel {
    background: #95a5a6;
    color: white;
}

.btn-cancel:hover {
    background: #7f8c8d;
}

.message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    display: none;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-content {
        flex-direction: column;
    }
    
    .side-panels {
        width: 100%;
        flex-direction: row;
        gap: 10px;
    }
    
    .panel {
        flex: 1;
    }
    
    .prayer-table th {
        font-size: 1.5em;
    }
    
    .prayer-table td {
        font-size: 1.5em;
    }
}

@media (max-width: 768px) {
    .container {
        height: auto;
        min-height: 100vh;
    }
    
    .header {
        flex-direction: column;
        text-align: center;
        padding: 15px 10px;
    }
    
    .logo-section {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 10px;
    }
    
    .logo {
        height: 60px;
    }
    
    .header h1 {
        font-size: 1.5em;
    }
    
    .date-time-section {
        text-align: center;
        margin-top: 10px;
    }
    
    .islamic-date {
        font-size: 0.9em;
    }
    
    .current-date {
        font-size: 0.85em;
    }
    
    .current-time {
        font-size: 1.2em;
    }
    
    .main-content {
        padding: 10px;
    }
    
    .side-panels {
        flex-direction: column;
        gap: 10px;
    }
    
    .prayer-table th {
        padding: 12px 8px;
        font-size: 1.2em;
    }
    
    .prayer-table td {
        padding: 12px 8px;
        font-size: 1.2em;
    }
    
    .panel h2 {
        font-size: 1.3em;
    }
    
    .next-prayer-name {
        font-size: 1.8em;
    }
    
    .next-prayer-time {
        font-size: 1.5em;
    }
    
    .countdown {
        font-size: 1.8em;
    }
    
    .jummah-time,
    .hijri-info {
        font-size: 1em;
    }
    
    .announcements-section {
        margin: 10px;
        padding: 15px;
        min-height: 100px;
    }
    
    .announcements-title {
        font-size: 1.3em !important;
    }
    
    .announcements-content {
        font-size: 1.1em !important;
        line-height: 1.5 !important;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .announcement-text {
        font-size: 1.2em !important;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.2em;
    }
    
    .logo {
        height: 50px;
    }
    
    .prayer-table th,
    .prayer-table td {
        padding: 10px 5px;
        font-size: 1em;
    }
    
    .next-prayer-name {
        font-size: 1.5em;
    }
    
    .countdown {
        font-size: 1.5em;
    }
    
    .announcements-title {
        font-size: 1.2em !important;
    }
    
    .announcements-content {
        font-size: 0.95em !important;
        line-height: 1.4 !important;
    }
}

/* Scheduled Changes and Background Image Styles */
.btn-schedule,
.btn-upload,
.btn-remove,
.btn-delete {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s ease;
}

.btn-schedule:hover,
.btn-upload:hover {
    background: linear-gradient(135deg, #2a5298 0%, #1e3c72 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-remove {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.btn-remove:hover {
    background: linear-gradient(135deg, #c82333 0%, #dc3545 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-delete {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    padding: 4px 8px;
    font-size: 0.9em;
}

.btn-delete:hover {
    background: linear-gradient(135deg, #c82333 0%, #dc3545 100%);
}

#changes-container {
    margin-top: 10px;
}

#background-preview img {
    display: block;
    margin-top: 10px;
    border-radius: 5px;
}
