body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background: radial-gradient(circle, #333, #000);
    color: #fff;
    min-height: 100vh;
    padding-top: 60px; /* Space for top nav */
}

.dark-theme {
    /* Already set as default */
}

.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: radial-gradient(circle, #222, #000);
    border-bottom: 1px solid #FFD700;
    z-index: 1000;
}

.top-nav ul {
    display: flex;
    justify-content: space-around;
    list-style: none;
    margin: 0;
    padding: 10px 0;
    flex-wrap: wrap;
}

.top-nav li {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    position: relative;
    padding: 0 10px;
}

.top-nav ion-icon {
    font-size: 24px;
    margin-bottom: 5px;
    color: #FFD700;
}

.top-nav span {
    font-size: 12px;
    color: #FFD700;
}

.top-nav li.active {
    color: #DAA520; /* Darker gold for active */
}

.top-nav li.active ion-icon,
.top-nav li.active span {
    color: #DAA520;
}

.dropdown {
    display: none;
    position: absolute;
    top: 60px; /* Below the nav */
    right: 0;
    background: #222;
    border: 1px solid #ec850f;
    border-radius: 8px;
    padding: 10px;
    width: 150px;
    z-index: 1001;
}

.dropdown ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dropdown li {
    padding: 10px;
    cursor: pointer;
    color: #16c0eb;
}

.dropdown li:hover {
    background: #800505;
}

main {
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

section {
    display: none;
    width: 100%;
    max-width: 800px;
    text-align: center;
}

section.active {
    display: block;
}

.url-input-container {
    display: flex;
    justify-content: center;
    margin-top: 50px;
    width: 100%;
}

#url-input {
    width: 80%;
    max-width: 600px;
    padding: 15px;
    font-size: 18px;
    border: 2px solid #FFD700;
    border-radius: 20px;
    background: radial-gradient(circle, #111, #000);
    color: #fff;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

#url-input::placeholder {
    color: #DAA520;
}

#progress-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
    width: 100%;
}

#progress-container.hidden {
    display: none;
}

#progress-container.processing {
    background: rgba(0, 120, 255, 0.1); /* Blue for processing */
}

#progress-container.success {
    background: rgba(0, 255, 0, 0.1); /* Green for success */
}

#retry-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
    width: 100%;
    background: rgba(255, 165, 0, 0.1); /* Orange for retry */
}

#retry-container.hidden {
    display: none;
}

#retry-message {
    font-size: 16px;
    color: #FF4500; /* Red for failure */
    margin-bottom: 10px;
}

#retry-btn {
    padding: 10px 20px;
    font-size: 16px;
    background: linear-gradient(#FF4500, #D2691E); /* Orange gradient for retry */
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

#retry-btn:hover {
    background: linear-gradient(#D2691E, #FF4500);
}

.spinner {
    border: 4px solid hsl(0, 0%, 97%);
    border-top: 4px solid #9108ec; /* Blue for processing */
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#progress-message {
    font-size: 16px;
    color: #0078FF; /* Blue for processing */
}

#progress-message.success {
    color: #00FF00; /* Green for success */
}

#progress-message.error {
    color: #FF4500; /* Red for error */
}

.progress-bar {
    width: 80%;
    max-width: 600px;
    height: 20px;
    background: #333;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 10px;
}

.progress-bar-fill {
    height: 100%;
    background: #0078FF; /* Blue for progress */
    width: 0%;
    transition: width 0.3s ease-in-out;
}

.progress-bar-fill.success {
    background: #00FF00; /* Green for success */
}

.progress-bar-fill.error {
    background: #FF4500; /* Red for error */
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: radial-gradient(circle, #222, #000);
    padding: 20px;
    border-radius: 20px;
    border: 1px solid #FFD700;
    text-align: center;
    width: 80%;
    max-width: 400px;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.modal-content h2 {
    color: #FFD700;
}

.modal-content button {
    display: block;
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    background: linear-gradient(#FFD700, #DAA520);
    color: #000;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
}

.modal-content button:hover {
    background: linear-gradient(#DAA520, #FFD700);
}

#cancel {
    background: linear-gradient(#dc3545, #bb2d3b);
    color: #fff;
}

#cancel:hover {
    background: linear-gradient(#bb2d3b, #dc3545);
}

/* Rating Modal */
#rating-modal .modal-content {
    background: #1a1a1a;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    max-width: 400px;
}

#rating-modal .stars {
    margin: 20px 0;
}

#rating-modal .stars ion-icon {
    font-size: 30px;
    color: #FFD700;
    cursor: pointer;
    transition: transform 0.2s;
}

#rating-modal .stars ion-icon.filled {
    transform: scale(1.2);
}

#rating-modal .stars ion-icon[data-rating="1"].filled::after {
    content: "😢";
    position: absolute;
    font-size: 20px;
    margin-left: 5px;
}

#rating-modal textarea {
    width: 100%;
    height: 100px;
    margin: 10px 0;
    padding: 10px;
    border: 1px solid #444;
    border-radius: 5px;
    background: #222;
    color: #fff;
    resize: vertical;
}

#rating-modal button {
    margin: 5px;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#submit-rating {
    background: linear-gradient(#FFD700, #DAA520);
    color: #000;
}

#submit-rating:hover {
    background: linear-gradient(#DAA520, #FFD700);
}

#close-rating {
    background: #444;
    color: #fff;
}

#close-rating:hover {
    background: #666;
}

/* Flash Message */
.flash-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(#FFD700, #DAA520);
    color: #000;
    padding: 15px 30px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    z-index: 2000; /* Increased to ensure visibility */
    font-weight: bold;
    font-size: 16px;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.flash-message.show {
    opacity: 1;
}

.flash-message.hidden {
    display: none;
}

.flash-message.error {
    background: linear-gradient(#FF4500, #B22222);
    color: #fff;
}

/* Install Button */
#install-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 10px 20px;
    background: linear-gradient(#FFD700, #DAA520);
    color: #000;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    z-index: 1000;
}

#install-btn:hover {
    background: linear-gradient(#DAA520, #FFD700);
}

.hidden {
    display: none;
}

/* Responsiveness */
@media (max-width: 768px) {
    #url-input {
        width: 95%;
        font-size: 16px;
    }

    .top-nav ul {
        justify-content: space-between;
        padding: 5px 0;
    }

    .top-nav li {
        padding: 0 5px;
    }

    .top-nav ion-icon {
        font-size: 22px;
    }

    .top-nav span {
        font-size: 10px;
    }

    main {
        padding: 10px;
    }

    .progress-bar {
        width: 95%;
    }
}

@media (min-width: 769px) {
    .top-nav ul {
        justify-content: center;
    }

    .top-nav li {
        margin: 0 20px;
    }
}

.cookies-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 500px;
    margin: 20px auto;
}
#cookie-data {
    width: 100%;
    height: 100px;
    padding: 10px;
    font-family: monospace;
}
#cookie-message {
    margin-top: 10px;
    padding: 10px;
}
#cookie-message.error {
    color: red;
}
#cookie-message:not(.error) {
    color: green;
}
.hidden {
    display: none;
}