/* Base styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    margin: 0;
    padding: 1rem;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(786deg, #6e8efb, #a777e3);
    transition: background 1s;
    color: white;
    overflow-x: hidden;
    scrollbar-width: none;
}

.container::-webkit-scrollbar {
    display: none;
}

/* Islamic Pattern Background */
.islamic-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.15;
    background-color: transparent;
    overflow: hidden;
}

/* Main container */
.container {
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    width: 95%;
    max-width: 600px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow-y: auto;
    max-height: 95vh;
    color: #FFFFFF;
    text-shadow: 0 2px 2px rgba(0, 0, 0, 0.8);
}

/* Header section - Current time and date */
.header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.masjid {
    font-size: clamp(1.2rem, 4vw, 1.5rem);
    font-weight: 300;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.current-time {
    font-size: clamp(2.5rem, 8vw, 3.5rem);
    font-weight: 300;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.current-date {
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    opacity: 0.8;
    font-weight: 500;
}

/* Prayer times list */
.prayer-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem 0;
    text-align: left;
}

.prayer-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.15);
    margin-bottom: 0.8rem;
    padding: 0.8rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    border-left: 4px solid rgba(255, 255, 255, 0.3);
    flex-wrap: wrap;
    gap: 0.5rem;
}

.prayer-name {
    font-size: clamp(1rem, 3vw, 1.2rem);
    font-weight: 600;
    min-width: 80px;
}

.prayer-time {
    font-size: clamp(1.1rem, 3vw, 1.3rem);
    font-weight: 600;
    min-width: 80px;
    text-align: right;
}

.meeqat-time {
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
    font-weight: 500;
    min-width: 80px;
    text-align: right;
    color: rgba(255, 255, 255, 0.8);
    display: none;
}

.meeqat-time.show {
    display: block;
}

.active {
    background: rgba(255, 255, 255, 0.35);
    border-left: 4px solid #f9ca24;
}

.almost-active {
    background: rgba(249, 202, 36, 0.2);
    border-left: 4px solid rgba(249, 202, 36, 0.5);
}

/* Admin section */
.admin-section {
    display: none;
    margin-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 1.5rem;
}

.admin-section.show {
    display: block;
}

.admin-title {
    font-size: clamp(1.2rem, 4vw, 1.5rem);
    margin-bottom: 1.5rem;
    font-weight: 400;
}

.prayer-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: left;
}

.form-group label {
    font-size: 0.9rem;
    opacity: 0.8;
}

.form-input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 0.5rem;
    padding: 0.8rem;
    color: white;
    font-size: 1rem;
    width: 100%;
    max-width: 200px;
}

/* Buttons */
.button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 0.8rem 1.2rem;
    border-radius: 0.5rem;
    font-size: clamp(0.9rem, 2.5vw, 1rem);
    cursor: pointer;
    transition: all 0.3s ease;
    width: auto;
    white-space: nowrap;
}

.button-primary {
    background: #4CAF50;
}

.button-primary:hover {
    background: #45a049;
}

.button-secondary {
    background: #2196F3;
}

.button-secondary:hover {
    background: #0b7dda;
}

.button-disabled {
    background: gray !important;
    cursor: not-allowed !important;
}

.button-disabled:hover {
    background: gray !important;
    cursor: not-allowed !important;
}

.admin-toggle {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.5rem;
    margin-top: 1rem;
    text-decoration: underline;
    transition: color 0.3s ease;
}

.admin-toggle:hover {
    color: rgba(255, 255, 255, 0.9);
}

.button-row {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* No prayers message */
.no-prayers {
    padding: 2rem 0;
    opacity: 0.7;
    font-style: italic;
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 2rem;
    font-size: clamp(0.8rem, 2.5vw, 0.9rem);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 100;
    width: 90%;
    max-width: 400px;
    text-align: center;
}

.toast.show {
    opacity: 1;
}

.circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    z-index: 0;
}

.circle-1 {
    width: 150px;
    height: 150px;
    top: 20%;
    left: 10%;
    animation: float 5s infinite alternate ease-in-out;
}

.circle-2 {
    width: 80px;
    height: 80px;
    bottom: 50%;
    right: 43%;
    animation: float 3s infinite alternate-reverse ease-in-out;
}

.circle-3 {
    width: 120px;
    height: 120px;
    top: 10%;
    right: 15%;
    animation: float 10s infinite alternate ease-in-out;
}

@keyframes float {
    0% {
        transform: translateY(300px) rotate(360deg);
    }

    100% {
        transform: translateY(-20px) rotate(10deg);
    }
}

.format-toggle {
    margin-top: 2rem;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1rem;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.format-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Password Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10;
    justify-content: center;
    align-items: center;
}

.modal {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 400px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal h3 {
    margin-bottom: 1.5rem;
}

.modal-overlay.show {
    display: flex;
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-left: 10px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Media Queries */
@media screen and (max-width: 480px) {
    body {
        padding: 0.5rem;
    }

    .container {
        padding: 1rem;
        width: 98%;
    }

    .prayer-item {
        padding: 0.6rem;
    }

    .button-row {
        justify-content: center;
        width: 100%;
    }

    .form-input {
        max-width: 100%;
    }
}

@media screen and (max-height: 700px) {
    .container {
        max-height: 98vh;
    }

    .header {
        margin-bottom: 1rem;
    }

    .prayer-item {
        margin-bottom: 0.5rem;
    }
}

.meeqat-toggle {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.5rem;
    margin-bottom: 1rem;
    text-decoration: underline;
    transition: all 0.3s ease;
    width: 100%;
    text-align: center;
}

.meeqat-toggle:hover {
    color: rgba(255, 255, 255, 0.9);
}

.meeqat-toggle.active {
    color: #4CAF50;
}

.amiri-regular {
    font-family: "Amiri", serif;
    font-weight: 400;
    font-style: normal;
}

.amiri-bold {
    font-family: "Amiri", serif;
    font-weight: 700;
    font-style: normal;
}

.amiri-regular-italic {
    font-family: "Amiri", serif;
    font-weight: 400;
    font-style: italic;
}

.amiri-bold-italic {
    font-family: "Amiri", serif;
    font-weight: 700;
    font-style: italic;
}

/* Tooltip styles */
.has-tooltip {
    position: relative;
}

.has-tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 5px 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 0.8rem;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
}

.has-tooltip:hover::before {
    content: '';
    position: absolute;
    bottom: calc(100% - 5px);
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: rgba(0, 0, 0, 0.8) transparent transparent transparent;
    z-index: 1000;
}