body {
    margin: 0;
}

.container {
    display: grid;
    grid-template-columns: 1fr 5fr; /* Sidebar and main content */
    min-height: 100vh; /* Ensure full viewport height */
}

.sidebar {
    min-width: 300px;
    box-sizing: border-box;
    position: sticky;
    top: 0;
    height: 100vh; /* Full height of the viewport */
    display: flex;
    flex-direction: column;
    padding: 30px;
    padding-right: 50px;
}

.logo {
    margin-bottom: 2rem;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 1rem; /* Space between links */
}

.sidebar-nav > .link {
    margin-left: 26px;
}

.sidebar-content {
    flex: 1; /* Allow this to grow and take available space */
    display: flex;
    flex-direction: column;
}

.manage-subscription {
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

.sidebar-bottom {
    margin-top: auto; /* Pushes the sidebar-bottom to the bottom */
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: space-between;
}

.main-content {
    position: relative;
    padding: 30px;
    padding-left: 0;
}

h2 {
    margin-top: 0;
}






/*Dropdown*/
.dropbtn {
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    color: var(--color-text-secondary);
    cursor: pointer;
    padding: 0px;
    border: none;
    background-color: inherit;
    display: flex;
    align-items: center;
    gap: 4px; /* Space between text and arrow */
}

.dropbtn .website-link {
    color: inherit;
    text-decoration: underline;
}

.dropbtn .website-link:hover {
    color: var(--color-text);
}

.dropbtn svg {
    width: 16px;
    height: 16px;
    position: relative;
    top: 1px; /* Fine-tune vertical alignment */
    fill: var(--color-text-secondary);
}

.dropbtn:hover {
    color: var(--color-text);
}

.dropbtn:hover svg {
    fill: var(--color-text);
}
    
    /* The container <div> - needed to position the dropdown content */
.dropdown {
    font-size: 16px;
    font-weight: inherit;
    font-family: inherit;
    color: var(--color-text);
    position: relative;
    display: inline-block;
}
    
    /* Dropdown Content (Hidden by Default) */
.dropdown-content {
    display: none;
    margin-top: 5px;
    right: 27px;
    position: absolute;
    min-width: 160px;
    z-index: 1;
    padding: 0;
}

/* Add a hidden connector to maintain hover state */
.dropdown-content::before {
    content: '';
    position: absolute;
    top: -7px; /* Same as negative margin-top */
    left: 0;
    right: 0;
    height: 7px; /* Same as margin-top */
    background-color: transparent;
}
    
    /* Links inside the dropdown */
.dropdown-content a {
    font-family: "Rubik", sans-serif;
    padding: 12px 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    border-radius: inherit;
}
    
    /* Change color of dropdown links on hover */
.dropdown-content a:hover {background-color: var(--color-white-hover)}
    
    /* Show the dropdown menu on hover */
.dropdown:hover .dropdown-content {
    display: block;
}

/* Sidebar favicons */
.sidebar-favicon {
    vertical-align: middle;
    margin-right: 6px;
    border-radius: 2px;
    flex-shrink: 0;
}

.container.no-sidebar {
    display: block; /* Override grid layout when no sidebar */
    padding: 0 90px; /* Add 90px padding on both sides */
}

.container.no-sidebar .main-content {
    padding: 30px 0; /* Keep vertical padding, remove horizontal padding since container handles it */
}

.public-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: -50px; /* Pull the content up to overlap with the title */
}

.public-header .website-name {
    margin: 0;
}

.mobile-only {
    display: none;
}

.top-right-nav {
    position: absolute;
    top: 30px;
    right: 140px;
    display: flex;
    gap: 1.5rem;
}

.top-right-nav .link {
    font-size: 16px;
}

.mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.mobile-menu-toggle {
    width: 24px;
    height: 24px;
    cursor: pointer;
    color: var(--color-text-secondary);
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
}

.mobile-menu-header .website-name {
    color: var(--color-primary);
    font-size: 30px;
    font-weight: 600;
    width: fit-content;
    display: inline;
    text-align: left;
}

.mobile-menu-header .mobile-menu-toggle {
    width: 24px;
    height: 24px;
    cursor: pointer;
}

/* Modal styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
}

.modal-content {
    max-width: 450px;
    margin: 20px;
}

.modal-content h3 {
    margin-top: 0;
    color: var(--color-danger);
}

.modal-content p {
    color: var(--color-text-secondary);
    line-height: 1.5;
}

.modal-content ul {
    color: var(--color-text-secondary);
    margin: 0 0 16px 0;
    padding-left: 20px;
}

.modal-content ul li {
    margin-bottom: 4px;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.modal-buttons .standard-button {
    flex: 1;
}

.modal-input {
    width: 100%;
    max-width: 240px;
    margin-top: 8px;
}

.modal-content .input-box:focus {
    border-color: var(--color-danger);
    box-shadow: 0 0 0 3px rgba(208, 51, 51, 0.15);
}

.modal-content .input-box::placeholder {
    letter-spacing: 1px;
}

/* Shared input styles for dashboard pages */
.input-box {
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    color: var(--color-text);
    background-color: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 10px 14px;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-box:focus {
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 3px var(--color-secondary-xlight);
}

.input-box::placeholder {
    color: var(--color-text-tertiary);
    font-weight: 400;
}

.danger-button {
    background-color: var(--color-danger);
    color: white;
    border-color: var(--color-danger);
}

.danger-button:hover:not(:disabled) {
    background-color: var(--color-danger-hover);
}

.danger-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.status-message {
    margin-top: 16px;
    padding: 10px;
    border-radius: 6px;
    text-align: center;
    background-color: #f3f4f6;
    color: var(--color-text-secondary);
}

.status-message.success {
    background-color: #d1fae5;
    color: #065f46;
}

.status-message.error {
    background-color: #fee2e2;
    color: var(--color-danger);
}

@media screen and (max-width: 768px) {
    .modal-buttons {
        flex-direction: column;
    }
}

@media screen and (max-width: 768px) {
    .sidebar {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: white;
        z-index: 1000;
        padding: 20px;
    }
    
    .sidebar.show {
        display: flex;
        flex-direction: column;
    }

    .mobile-menu-header {
        padding: 20px;
        text-align: right;
    }

    .sidebar .logo {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .sidebar-content {
        display: flex;
        flex-direction: column;
        height: 100%;
    }

    .sidebar-bottom {
        margin-top: auto;
    }
    
    .container {
        display: block;
        padding: 20px;
    }

    .container.no-sidebar {
        padding: 20px;
    }

    .main-content {
        padding: 0;
    }

    .mobile-only {
        display: block;
    }

    .desktop-only {
        display: none;
    }

    .website-name {
        text-align: left;
        margin-bottom: 0;  /* Remove bottom margin since it's handled by mobile-header */
    }

    /* Disable CSS hover dropdown on mobile — use JS click instead */
    .dropdown:hover .dropdown-content {
        display: none;
    }

    .dropdown .dropdown-content.show {
        display: block;
    }

    .dropdown-arrow {
        cursor: pointer;
        padding: 8px;
    }
}
