body {
    font-family: 'Roboto', sans-serif;
    background-color: #f4f7f9;
    color: #2c3e50;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    flex-direction: column;
}

body.admin-view .main-header {
    display: none;
}

body.admin-view .main-header, body.admin-view .verification-banner, body.admin-view .global-announcement-banner {
    display: none;
}

body.admin-view .verification-banner {
    top: 0;
}

.main-header {
    background-color: #ffffff;
    padding: 0;
    box-shadow: 0 2px 4px rgba(44,62,80,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
    margin-bottom: 2rem;
}

/* New Navigation Styles */
.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1400px; /* Wider for nav */
    margin: 0 auto;
    position: relative;
}

.nav-logo a {
    font-size: 1.8rem;
    font-weight: 900;
    color: #2c3e50;
    text-decoration: none;
}

.nav-links-container {
    flex-grow: 1;
    display: flex;
    justify-content: center;
}

.nav-links-container .nav-auth-mobile {
    display: none; /* Hidden on desktop */
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2.5rem;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav-links a {
    color: #34495e;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.nav-links a:hover {
    color: #3D8BFD;
}

.dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 110%;
    left: 50%;
    transform: translateX(-50%);
    background-color: white;
    box-shadow: 0 8px 24px rgba(44,62,80,0.1);
    border-radius: 8px;
    padding: 0.5rem 0;
    list-style: none;
    min-width: 220px;
    z-index: 101;
    border: 1px solid #e5e9f2;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, top 0.2s ease;
}

.dropdown:hover .dropdown-menu {
    display: block;
    opacity: 1;
    visibility: visible;
    top: 100%;
}

.dropdown-menu li a {
    display: block;
    padding: 0.75rem 1.5rem;
    white-space: nowrap;
}

.dropdown-icon {
    font-size: 0.7em;
    transition: transform 0.2s ease;
}

.dropdown:hover .dropdown-icon {
    transform: rotate(180deg);
}

.nav-auth {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #2c3e50;
    z-index: 1002;
}

.header-content {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
}

#login-button, #logout-button {
    background-color: #3D8BFD;
    border: 1px solid #3D8BFD;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    margin: 0;
}

#login-button:hover, #logout-button:hover {
    background-color: #2a79fc;
    box-shadow: 0 4px 10px rgba(61, 139, 253, 0.2);
    transform: translateY(-2px);
}

#logout-button {
    background-color: #e74c3c;
    border-color: #e74c3c;
    margin: 0;
}

#logout-button:hover {
    background-color: #c0392b;
    box-shadow: 0 4px 10px rgba(231, 76, 60, 0.2);
}

#user-display {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    background-color: #eaf3fe;
    color: #2a79fc;
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
    margin-right: 0;
    border: 1px solid #c1d9fb;
    box-shadow: 0 2px 4px rgba(61,139,253,0.1);
}

#user-display-icon {
    font-size: 1.1rem;
    line-height: 1;
}

.user-display-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 150px;
}

#login-indicator {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-right: 0;
    font-weight: 500;
}

#login-indicator.unverified {
    color: #e67e22;
    background-color: #fdf3e7;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
}

.verification-banner {
    background-color: #f39c12; /* Warning color */
    color: white;
    padding: 1rem;
    text-align: center;
    font-weight: 500;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.95rem;
    line-height: 1.4;
    position: sticky;
    top: 75px; /* Adjust based on new header height */
    z-index: 99;
    animation: fadeIn 0.3s ease-out;
}

.admin-nav-toggle {
    display: none;
    background: none;
    border: 2px solid #dde2e7;
    font-size: 1.2rem;
    cursor: pointer;
    color: #526476;
    z-index: 1002;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    transition: all 0.2s;
}

.admin-nav-toggle:hover {
    border-color: #3D8BFD;
    color: #3D8BFD;
    background-color: #eaf3fe;
}

#resend-verification-btn {
    background-color: transparent;
    border: 2px solid white;
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0; /* Override button defaults */
}

#resend-verification-btn:hover {
    background-color: white;
    color: #f39c12;
    transform: none; /* Override general button hover */
    box-shadow: none; /* Override general button hover */
}

.global-announcement-banner {
    background: linear-gradient(135deg, #3D8BFD, #2a79fc);
    color: white;
    padding: 0.8rem 2rem;
    text-align: center;
    font-weight: 500;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    font-size: 0.95rem;
    position: relative;
    animation: fadeInDown 0.5s ease-out;
}

#global-announcement-banner-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s, transform 0.2s;
    padding: 0 0.5rem;
}

#global-announcement-banner-close:hover {
    opacity: 1;
    transform: scale(1.1);
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}

main {
    padding: 1rem 2rem 2rem;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    margin: 2rem auto;
    flex-grow: 1;
}

#main-content {
    max-width: 1200px;
    margin: 0 auto;
}

body.admin-view main {
    margin: 0;
    padding: 0; /* Remove padding as admin-panel will have it */
    flex-grow: 1;
}

body.admin-view #main-content {
    max-width: none;
    margin: 0;
}

h1 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 2.8rem; /* Increased size */
    font-weight: 900; /* Bolder */
    background: linear-gradient(
        -45deg, 
        #4e8ef7, 
        #3D8BFD, 
        #2ecc71, 
        #9b59b6,
        #f39c12,
        #4e8ef7
    );
    background-size: 600% 600%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
    display: inline-block;
    padding-bottom: 0.2rem;
    animation: gradient-animation 18s ease infinite;
    text-shadow: 0px 3px 6px rgba(0, 0, 0, 0.05);
}

@keyframes gradient-animation {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.subtitle {
    display: none;
}

.site-description {
    color: #526476;
    font-size: 1.1rem;
    line-height: 1.6;
    max-width: 700px;
    margin: -1rem auto 2rem auto;
}

.editor-card {
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(44, 62, 80, 0.1);
    padding: 2rem;
    border: 1px solid #e5e9f2;
}

.editor-container {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    text-align: left;
}

.left-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 280px;
}

.left-panel h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    color: #34495e;
    text-align: left;
}

.right-panel {
    flex: 2;
    display: flex;
    flex-direction: column;
    min-width: 300px;
}

.voice-list-accordion {
    border: 1px solid #dde2e7;
    border-radius: 8px;
    overflow-y: auto;
    height: 350px;
    background-color: #fdfdfd;
    flex-grow: 1;
    padding: 0.5rem;
}

.voice-category {
    margin-bottom: 0.5rem;
}
.voice-category:last-child {
    margin-bottom: 0;
}

.voice-category-toggle {
    display: flex;
    align-items: center;
    width: 100%;
    text-align: left;
    background-color: #f0f3f5;
    padding: 0.8rem 1rem;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 700;
    color: #34495e;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.voice-category-toggle:hover {
    background-color: #e5e9f2;
}

.voice-category-toggle.open {
    background-color: #eaf3fe;
    border-color: #c1d9fb;
    color: #2a79fc;
}

.category-name {
    flex-grow: 1;
}

.category-count {
    font-size: 0.85rem;
    font-weight: 500;
    color: #7f8c8d;
    margin: 0 0.75rem;
}
.voice-category-toggle.open .category-count {
    color: #3D8BFD;
}

.category-arrow {
    font-size: 0.8rem;
    transition: transform 0.2s ease-in-out;
}
.voice-category-toggle:not(.open) .category-arrow {
    transform: rotate(-90deg);
}

.voice-category-content {
    padding: 0.5rem 0.2rem 0.2rem 0.2rem;
    border-left: 1px solid #e5e9f2;
    border-right: 1px solid #e5e9f2;
    border-bottom: 1px solid #e5e9f2;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
    display: block;
}

.voice-category-content.hidden {
    display: none;
}

.voice-list {
    border: 1px solid #dde2e7;
    border-radius: 8px;
    overflow-y: auto;
    height: 350px;
    background-color: #fdfdfd;
    flex-grow: 1;
    padding: 0;
}

.voice-list-placeholder {
    padding: 1rem;
    color: #95a5a6;
    text-align: center;
    line-height: 1.5;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.voice-category-header-inline {
    background-color: #f0f3f5;
    color: #34495e;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 0.5rem 1.2rem;
    position: sticky;
    top: 0;
    z-index: 10;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e5e9f2;
    border-top: 1px solid #e5e9f2;
}
.voice-category-header-inline:first-child {
    border-top: none;
}

.voice-item {
    padding: 0.9rem 1.2rem;
    border-bottom: 1px solid #e5e9f2;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, border-left-color 0.2s;
    text-align: left;
    border-left: 5px solid transparent;
    margin: 0 0.2rem 0.3rem 0.2rem;
    border-radius: 4px;
    border-bottom: none;
}

.voice-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.voice-item:hover {
    background-color: #f4f7f9;
}

.voice-item.selected {
    background-color: #eaf3fe;
    color: #2a79fc;
    font-weight: 700;
    border-left-color: #3D8BFD;
}

.voice-item.premium.selected {
    border-left-color: #1abc9c;
    background-color: #e8f8f5;
    color: #16a085;
}

.voice-item.premium.selected .voice-item-lang {
    color: #16a085;
}

.voice-item.selected .voice-item-lang {
    color: #3D8BFD;
}

.voice-item.locked {
    color: #95a5a6;
}

.voice-item.locked .voice-item-name,
.voice-item.locked .voice-item-lang {
    color: #bdc3c7;
}

.voice-item.locked:hover {
    background-color: #f8f9fa;
}

.voice-item.locked.selected {
    background-color: #fcf3f2;
    color: #c0392b;
    border-left-color: #e74c3c;
}

.voice-item.locked.selected .voice-item-name,
.voice-item.locked.selected .voice-item-lang {
    color: #c0392b;
}

.voice-item-name {
    display: flex;
    align-items: center;
}

.voice-status-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #e67e22;
    margin-left: 8px;
    background-color: #fdf3e7;
    padding: 2px 6px;
    border-radius: 4px;
}

.voice-item-lang {
    display: block;
    font-size: 0.8rem;
    color: #95a5a6;
    transition: color 0.2s;
}

.premium-toggle-btn {
    width: 100%;
    margin-top: 1rem;
    background-color: #1abc9c;
    color: white;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.premium-toggle-btn:hover {
    background-color: #16a085;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(26, 188, 156, 0.2);
}

.controls {
    margin-bottom: 0;
    text-align: left;
}

.controls label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 700;
    color: #34495e;
}

.voice-filter-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.voice-filter-group {
    display: flex;
    gap: 0.5rem;
    background-color: #f0f3f5;
    padding: 0.4rem;
    border-radius: 9px;
    width: 100%;
    box-sizing: border-box;
}

.voice-filter-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    background-color: #f0f3f5;
    padding: 0.5rem;
    border-radius: 8px;
    flex-wrap: wrap;
}

.voice-filter-btn {
    flex-grow: 1;
    text-align: center;
    padding: 0.6rem 0.5rem;
    font-size: 0.9rem;
    font-weight: 700;
    border: none;
    border-radius: 6px;
    background-color: transparent;
    color: #526476;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.filter-count {
    font-size: 0.8em;
    font-weight: 500;
    color: #7f8c8d;
    background-color: rgba(0,0,0,0.05);
    padding: 2px 6px;
    border-radius: 8px;
    transition: all 0.2s ease-in-out;
}

.voice-filter-btn:hover .filter-count {
    color: #34495e;
    background-color: #dde2e7;
}

.voice-filter-btn.active .filter-count {
    color: #fff;
    background-color: rgba(0,0,0,0.2);
}

.voice-filter-btn:hover {
    background-color: #e5e9f2;
    transform: none; /* Override default button hover */
    box-shadow: none;
}

.voice-filter-btn.active {
    background-color: #fff;
    color: #3D8BFD;
    box-shadow: 0 2px 5px rgba(44,62,80,0.1);
}

.voice-filter-btn[data-filter="female"].active {
    background-color: #fce4ec; /* Light pink */
    color: #d81b60;
}

.voice-filter-btn[data-filter="male"].active {
    background-color: #e3f2fd; /* Light blue */
    color: #1976d2;
}

#premium-voice-section {
    text-align: left;
    margin: 0;
    padding: 0;
}

#premium-voice-section > label {
    display: block;
    margin-bottom: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    font-size: 1.4rem;
    text-align: center;
    border-bottom: 1px solid #e5e9f2;
    padding-bottom: 1rem;
}

#premium-controls-container {
    margin-bottom: 2rem;
    flex-shrink: 0;
    animation: fadeIn 0.3s ease-out;
}

.ai-text-tools {
    margin: 1.5rem 0;
    text-align: left;
}

.ai-text-tools label {
    display: block;
    margin-bottom: 0.8rem;
    font-weight: 700;
    color: #34495e;
}

.ai-text-tools .tool-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.ai-tool-btn {
    background-color: #f0f3f5;
    color: #526476;
    border: 1px solid #dde2e7;
    padding: 0.7rem 1rem;
    font-size: 0.9rem;
    transition: all 0.2s ease-in-out;
    text-align: center;
}

.ai-tool-btn:hover {
    background-color: #eaf3fe;
    color: #3D8BFD;
    border-color: #c1d9fb;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(61,139,253,0.1);
}

.premium-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.premium-controls label {
    font-weight: 700;
    color: #495057;
    font-size: 0.9rem;
}

#speaking-style-select {
    flex-grow: 1;
    padding: 0.6rem;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background-color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 0 0 0 0.2rem rgba(61,139,253,.25);
}

#speaking-style-select:focus {
    outline: none;
    border-color: #3D8BFD;
    box-shadow: 0 0 0 3px rgba(61,139,253,.15);
}

.premium-voice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.voice-category-header {
    grid-column: 1 / -1;
    text-align: left;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #3D8BFD;
}
.voice-category-header:first-child {
    margin-top: 0;
}

.voice-category-header h3 {
    margin: 0;
    color: #34495e;
    font-size: 1.2rem;
    font-weight: 700;
}

.premium-voice-item {
    background: #ffffff;
    border: 1px solid #e5e9f2;
    border-radius: 10px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 2px 5px rgba(44,62,80,0.05);
}

.premium-voice-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 15px rgba(44,62,80,0.1);
    border-color: #3D8BFD;
}

.premium-voice-item.surprise {
    background: linear-gradient(135deg, #434343 0%, #000000 100%);
    border-color: #555;
}

.premium-voice-item.surprise:hover {
     border-color: #1abc9c;
     box-shadow: 0 5px 12px rgba(26, 188, 156, 0.2);
}

.premium-voice-item.surprise .premium-voice-name {
    color: #1abc9c;
    font-family: 'Courier New', Courier, monospace;
}

.premium-voice-item.surprise .premium-voice-lang {
    color: #aaa;
}

.premium-voice-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    padding-right: 0.5rem;
}

.premium-voice-name {
    font-weight: 700;
    color: #34495e;
    font-size: 1rem;
    text-overflow: ellipsis;
    overflow: hidden;
}

.premium-voice-lang {
    font-size: 0.8rem;
    color: #95a5a6;
}

.play-premium-btn {
    background-color: #eaf3fe;
    color: #3D8BFD;
    border: 1px solid transparent;
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
    line-height: 1;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
}

.play-premium-btn:hover {
    background-color: #3D8BFD;
    color: #fff;
    transform: scale(1.1);
}

.premium-voice-item.surprise .play-premium-btn {
    background-color: #2c3e50;
    color: #1abc9c;
}

.premium-voice-item.surprise .play-premium-btn:hover {
    background-color: #1abc9c;
    color: #fff;
}

#text-input {
    width: 100%;
    height: 100%;
    min-height: 200px;
    padding: 1.2rem;
    border: 1px solid #dde2e7;
    border-radius: 8px;
    font-size: 1.1rem;
    font-family: 'Roboto', sans-serif;
    resize: vertical;
    box-sizing: border-box;
    margin: 0 0 1.5rem 0;
    transition: border-color 0.2s, box-shadow 0.2s;
    flex-grow: 1;
    background-color: #fdfdfd;
}

#text-input:focus {
    outline: none;
    border-color: #3D8BFD;
    box-shadow: 0 0 0 3px rgba(61,139,253,.15);
}

.narration-controls {
    display: flex;
    justify-content: space-around;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-shrink: 0;
}

.control-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
}

.control-group label {
    font-weight: 700;
    color: #34495e;
    margin-bottom: 0.8rem;
}
.control-group label {
    font-weight: 500;
    color: #34495e;
    margin-bottom: 0.8rem;
    display: flex;
    justify-content: space-between;
    width: 100%;
    align-items: center;
}

.control-group input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: #e5e9f2;
    border-radius: 5px;
    outline: none;
    transition: opacity .2s;
    cursor: pointer;
}

.control-group input[type="range"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.control-group input[type="range"]:disabled::-webkit-slider-thumb {
    background: #bdc3c7;
}
.control-group input[type="range"]:disabled::-moz-range-thumb {
    background: #bdc3c7;
}
.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #3D8BFD;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #3D8BFD;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.control-group span {
    background-color: #eaf3fe;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.9rem;
    min-width: 2.5em;
    text-align: center;
    color: #3D8BFD;
    font-weight: 700;
}

.buttons {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    align-items: center;
    margin-bottom: 0;
    flex-shrink: 0;
}

.download-note {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #7f8c8d;
    text-align: center;
}

.secondary-buttons {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
    flex-wrap: wrap;
}

button {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

button:hover {
     box-shadow: 0 4px 10px rgba(44,62,80,0.1);
     transform: translateY(-2px);
}
button:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(44,62,80,0.1);
}

#speak-button {
    background-color: #3D8BFD;
    color: white;
    width: 100%;
    padding-top: 1rem;
    padding-bottom: 1rem;
    font-size: 1.2rem;
}

#speak-button:disabled {
    background-color: #a0c4ff;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#speak-button:hover {
    background-color: #2a79fc;
}

#stop-button, #download-button {
    background-color: #ecf0f1;
    color: #34495e;
    padding: 0.7rem 1.2rem;
    font-size: 0.9rem;
}

#stop-button:hover, #download-button:hover {
    background-color: #e0e5e8;
}

#download-button {
    background-color: #2ecc71;
    color: white;
}
#download-button:hover {
    background-color: #27ae60;
}
#download-button:disabled {
    background-color: #95d4b0;
    cursor: not-allowed;
    opacity: 0.8;
    transform: none;
    box-shadow: none;
}

#save-button {
    background-color: #9b59b6;
    color: white;
}

#save-button:hover {
    background-color: #8e44ad;
}

#save-button:disabled {
    background-color: #c8b6d3;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#main-content.hidden {
    display: none;
}

#verify-email-prompt {
    max-width: 600px;
    margin: 4rem auto;
    padding: 2.5rem;
    background-color: #fff;
    border-radius: 16px;
    text-align: center;
    border: 1px solid #e5e9f2;
    box-shadow: 0 8px 30px rgba(44, 62, 80, 0.1);
    animation: fadeIn 0.4s ease-out;
}
#verify-email-prompt h2 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: #2c3e50;
}
#verify-email-prompt p {
    color: #526476;
    line-height: 1.6;
    margin-bottom: 1rem;
}
#verify-email-prompt button {
    margin-top: 1rem;
    background-color: #3D8BFD;
    color: white;
}
#verify-email-prompt button:hover {
    background-color: #2a79fc;
}

#verify-email-prompt .form-note {
    font-size: 0.9rem;
    color: #7f8c8d;
    background-color: #f4f7f9;
    padding: 0.8rem;
    border-radius: 6px;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid #e5e9f2;
}

/* Community Narrations Section Styling (REMOVED) */

#download-instructions .modal-content {
    max-width: 550px;
}

#download-instructions .modal-content button {
    margin-top: 1rem;
    padding: 0.7rem 1.5rem;
}

#start-record-button {
    background-color: #3D8BFD;
    color: white;
}

#start-record-button:hover {
    background-color: #2a79fc;
}

#download-instructions h3 {
    margin-top: 0;
    color: #3D8BFD;
    margin-bottom: 1rem;
}

#download-instructions p {
    line-height: 1.6;
    color: #34495e;
    margin-bottom: 1rem;
}

#download-instructions ol {
    text-align: left;
    margin: 1.5rem 0;
    padding-left: 25px;
    font-size: 0.9rem;
}

#download-instructions li {
    margin-bottom: 0.8rem;
}

.guide-gif {
    width: 100%;
    max-width: 450px;
    border-radius: 8px;
    border: 1px solid #dde2e7;
    margin: 0.5rem 0 1.5rem 0;
}

#download-instructions .note {
    font-size: 0.9rem;
    color: #7f8c8d;
    background-color: #f4f7f9;
    padding: 0.8rem;
    border-radius: 6px;
    margin-top: -0.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid #e5e9f2;
}

#close-instructions-button {
    background-color: #bdc3c7;
    color: #2c3e50;
}

#close-instructions-button:hover {
    background-color: #95a5a6;
    color: white;
}

.auth-domain-display {
    background-color: #f8f9fa;
    border: 1px solid #dde2e7;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    text-align: center;
}

.auth-domain-display code {
    background: none;
    padding: 0;
    font-size: 1.1rem;
    color: #3D8BFD;
    font-weight: bold;
}

.hidden {
    display: none !important;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 20, 30, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 1rem;
    box-sizing: border-box;
    animation: fadeIn 0.3s ease-out;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 95%;
    max-width: 450px;
    position: relative;
    text-align: center;
    animation: slideIn 0.4s cubic-bezier(0.215, 0.61, 0.355, 1);
}

@keyframes slideIn {
    from { transform: translateY(30px) scale(0.98); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-content.premium-modal {
    max-width: 0;
    padding: 0;
    border: none;
    opacity: 0;
}

#plan-editor-modal .modal-content,
#assign-plan-modal .modal-content {
    text-align: left;
}

#plan-editor-modal h2,
#assign-plan-modal h2 {
    text-align: center;
}

#assign-plan-modal p {
    text-align: center;
    margin-bottom: 1.5rem;
}

.plan-selection-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.plan-selection-option {
    padding: 1rem;
    border: 2px solid #dde2e7;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    font-weight: 700;
}

.plan-selection-option:hover {
    border-color: #c1d9fb;
    background-color: #f8f9fa;
}

.plan-selection-option.selected {
    border-color: #3D8BFD;
    background-color: #eaf3fe;
    color: #2a79fc;
    box-shadow: 0 0 0 3px rgba(61,139,253,.15);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
}

.auth-prompt {
    background-color: #eaf3fe;
    color: #3D8BFD;
    border: 1px solid #c1d9fb;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

.auth-prompt h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: #2a79fc;
}

.auth-prompt p {
    margin: 0;
    color: #34495e;
    line-height: 1.5;
}

.premium-modal #premium-voice-section {
    display: none;
}

.modal-content h2 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: #2c3e50;
    font-size: 1.8rem;
}

.modal-content p.form-switcher {
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 0;
}

.modal-content p.form-switcher a {
    color: #3D8BFD;
    text-decoration: none;
    font-weight: 700;
}

.modal-content p.form-switcher a:hover {
    text-decoration: underline;
}

.modal-content .form-note {
    font-size: 0.8rem;
    color: #7f8c8d;
    background-color: #f4f7f9;
    padding: 0.5rem;
    border-radius: 4px;
    margin-top: -0.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid #e5e9f2;
}

.close-button {
    position: absolute;
    top: 15px;
    right: 20px;
    background: #ecf0f1;
    border: none;
    font-size: 1.5rem;
    color: #95a5a6;
    cursor: pointer;
    line-height: 1;
    transition: all 0.2s;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0; /* remove default button padding */
}

.close-button:hover {
    color: #fff;
    background-color: #e74c3c;
    transform: rotate(90deg);
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 700;
    color: #34495e;
}

.form-group input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #dde2e7;
    border-radius: 8px;
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #3D8BFD;
    box-shadow: 0 0 0 3px rgba(61,139,253,.15);
}

.submit-login {
    width: 100%;
    padding: 0.9rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    background-color: #3D8BFD;
    color: white;
    transition: all 0.2s ease-in-out;
}

.submit-login:hover {
    background-color: #2a79fc;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(61,139,253,0.2);
}

.submit-login:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(44,62,80,0.1);
}

.submit-login:disabled {
    background-color: #95d4b0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.7;
}

.separator {
    display: flex;
    align-items: center;
    text-align: center;
    color: #95a5a6;
    margin: 1.5rem 0;
    font-size: 0.9rem;
}

.separator::before,
.separator::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e5e9f2;
}

.separator:not(:empty)::before {
    margin-right: .5em;
}

.separator:not(:empty)::after {
    margin-left: .5em;
}

.google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 0.8rem 1.5rem;
    background-color: #ffffff;
    color: #34495e;
    border: 1px solid #dde2e7;
    box-shadow: 0 2px 4px rgba(44,62,80,0.05);
}

.google-btn:hover {
    background-color: #f8f9fa;
    border-color: #c8ced3;
}

.google-icon {
    width: 18px;
    height: 18px;
}

.form-byline {
    margin-top: 2rem;
    margin-bottom: -1rem;
    font-size: 0.8rem;
    color: #95a5a6;
    text-align: center;
}

.form-byline strong {
    color: #526476;
    font-weight: 700;
}

/* Floating Chat Widget */
#chat-fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background-color: #3D8BFD;
    color: white;
    border-radius: 50%;
    border: none;
    font-size: 2rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(61, 139, 253, 0.4);
    cursor: pointer;
    z-index: 1010;
    transition: all 0.3s cubic-bezier(0.215, 0.61, 0.355, 1);
}

#chat-fab:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 20px rgba(61, 139, 253, 0.4);
}

#chat-widget {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 360px;
    max-width: calc(100% - 40px);
    max-height: 70vh;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(44, 62, 80, 0.2);
    display: flex;
    flex-direction: column;
    z-index: 1009;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.215, 0.61, 0.355, 1);
}

#chat-widget.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.chat-header {
    background: linear-gradient(135deg, #3D8BFD, #2a79fc);
    color: white;
    padding: 0.8rem 1rem;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
}

#chat-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    line-height: 1;
    opacity: 0.8;
    cursor: pointer;
}
#chat-close-btn:hover {
    opacity: 1;
}

.chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.chat-message {
    display: flex;
    flex-direction: column;
    max-width: 80%;
    word-wrap: break-word;
}

.message-author {
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: #7f8c8d;
}

.message-text {
    padding: 0.6rem 0.9rem;
    border-radius: 12px;
    line-height: 1.4;
    font-size: 0.9rem;
}

.chat-message.sent {
    align-self: flex-end;
    align-items: flex-end;
}
.chat-message.sent .message-text {
    background-color: #3D8BFD;
    color: white;
    border-bottom-right-radius: 4px;
}
.chat-message.sent .message-author {
    color: #3D8BFD;
}

.chat-message.received {
    align-self: flex-start;
    align-items: flex-start;
}
.chat-message.received .message-text {
    background-color: #ecf0f1;
    color: #34495e;
    border-bottom-left-radius: 4px;
}
.chat-message.received .message-author {
    color: #34495e;
}

.chat-placeholder {
    color: #95a5a6;
    text-align: center;
    font-size: 0.9rem;
    align-self: center;
    margin: auto;
}

.chat-form {
    display: flex;
    padding: 0.8rem;
    border-top: 1px solid #e5e9f2;
}

#chat-input {
    flex-grow: 1;
    border: none;
    outline: none;
    padding: 0.5rem;
    background: transparent;
    font-size: 0.9rem;
}

#chat-form button {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #3D8BFD;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
}
#chat-form button:hover {
    transform: scale(1.1);
    color: #2a79fc;
}

/* Notification System */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 15px;
    width: 360px; /* Slightly wider */
    max-width: 90vw;
}

.notification {
    background-color: #ffffff;
    color: #34495e;
    padding: 1rem 1.25rem; /* Adjusted padding */
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(44, 62, 80, 0.2); /* Enhanced shadow */
    transform: translateX(calc(100% + 20px));
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.215, 0.61, 0.355, 1); /* Smoother transition */
    width: 100%;
    display: flex;
    align-items: center; /* Vertically center icon and content */
    gap: 1rem;
    border: 1px solid #e5e9f2; /* Subtle border */
    position: relative;
    overflow: hidden;
}

.notification::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px; /* Thicker accent bar */
    height: 100%;
    background-color: #34495e;
    transition: background-color 0.3s;
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification-icon {
    font-size: 1.5rem;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
}

.notification-content {
    flex-grow: 1;
    padding-right: 20px; /* Space for close button */
}

.notification-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.2rem; /* Reduced margin */
    color: #2c3e50;
}

.notification-message {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #526476;
    margin: 0; /* Reset margin */
}

.notification-close-btn {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    color: #95a5a6;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s;
    padding: 4px;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-close-btn:hover {
    color: #e74c3c;
    background-color: #fdedec;
    transform: scale(1.1);
}

.notification.info::before,
.notification.info .notification-icon {
    background-color: #3D8BFD;
}
.notification.info .notification-title { color: #2a79fc; }

.notification.success::before,
.notification.success .notification-icon {
    background-color: #2ecc71;
}
.notification.success .notification-title { color: #27ae60; }

.notification.warning::before,
.notification.warning .notification-icon {
    background-color: #f39c12;
}
.notification.warning .notification-title { color: #d68910; }

.notification.error::before,
.notification.error .notification-icon {
    background-color: #e74c3c;
}
.notification.error .notification-title { color: #c0392b; }

.notification-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.1);
    animation: progress-countdown linear;
}

.notification.show .notification-progress {
    animation-play-state: running;
}

.notification:hover .notification-progress {
    animation-play-state: paused;
}

@keyframes progress-countdown {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

/* --- Start of Admin Chat View Changes --- */
#admin-messages-section h3 {
    margin-bottom: 1.5rem;
}

.admin-chat-view {
    display: flex;
    height: calc(100vh - 240px); /* Adjust height based on surrounding elements */
    min-height: 600px;
    background-color: #fff;
    border: 1px solid #e5e9f2;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(44,62,80,0.05);
    position: relative; /* For mobile view */
}

.admin-chat-sidebar {
    width: 320px;
    border-right: 1px solid #e5e9f2;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: transform 0.3s ease-in-out; /* For mobile sliding */
    height: 100%;
    overflow-y: auto; /* Allow sidebar to scroll if its content is too tall */
}

.admin-chat-sidebar .sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid #e5e9f2;
}

.admin-chat-sidebar .sidebar-header h4 {
    margin: 0 0 0.8rem 0;
    font-size: 1.1rem;
    color: #34495e;
}

#chat-user-search {
    width: 100%;
    padding: 0.6rem 0.9rem;
    border-radius: 8px;
    border: 1px solid #dde2e7;
    font-size: 0.9rem;
    background-color: #f8f9fa;
    box-sizing: border-box;
}
#chat-user-search:focus {
    outline: none;
    border-color: #3D8BFD;
    background-color: #fff;
}

.admin-chat-user-list {
    flex-grow: 1;
    overflow-y: auto;
}

.chat-user-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem;
    border-bottom: 1px solid #f0f3f5;
    cursor: pointer;
    transition: background-color 0.2s;
}
.chat-user-item:hover {
    background-color: #f8f9fa;
}
.chat-user-item.active {
    background-color: #eaf3fe;
}
.chat-user-item.active .user-name {
    color: #3D8BFD;
}

.chat-user-item .user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    white-space: nowrap;
}

.chat-user-item .user-info {
    flex-grow: 1;
    overflow: hidden;
}

.chat-user-item .user-name {
    font-weight: 700;
    color: #34495e;
    font-size: 1rem;
    margin: 0;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.chat-user-item .last-message {
    font-size: 0.85rem;
    color: #7f8c8d;
    margin: 0.2rem 0 0 0;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.admin-chat-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.admin-chat-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
    color: #7f8c8d;
    padding: 2rem;
}
.admin-chat-welcome .welcome-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    line-height: 1;
    background-color: #f4f7f9;
    padding: 1.5rem;
    border-radius: 50%;
    color: #bdc3c7;
}
.admin-chat-welcome h4 {
    color: #526476;
    font-size: 1.4rem;
    margin: 0 0 0.5rem 0;
}
.admin-chat-welcome p {
    max-width: 300px;
    line-height: 1.6;
}

#admin-chat-conversation-view {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.conversation-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e9f2;
    background-color: #f8f9fa;
}
.conversation-header .user-card-avatar {
    width: 48px;
    height: 48px;
    font-size: 1.5rem;
    margin: 0;
    box-shadow: none;
    border: none;
}
.conversation-header h5 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c3e50;
}
.conversation-header p {
    margin: 0;
    font-size: 0.9rem;
    color: #7f8c8d;
}

.conversation-back-btn {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #526476;
    padding: 0 0.8rem 0 0;
    line-height: 1;
    font-weight: bold;
    transition: color 0.2s;
}

.conversation-back-btn:hover {
    color: #3D8BFD;
}

.admin-chat-log {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.admin-chat-form {
    display: flex;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e9f2;
    gap: 1rem;
    background-color: #f8f9fa;
}

#admin-chat-input {
    flex-grow: 1;
    border-radius: 8px;
    border: 1px solid #dde2e7;
    padding: 0.8rem 1rem;
    font-size: 0.9rem;
    transition: all 0.2s;
}
#admin-chat-input:focus {
    outline: none;
    border-color: #3D8BFD;
    box-shadow: 0 0 0 3px rgba(61,139,253,.15);
}

#admin-chat-form button {
    background-color: #3D8BFD;
    color: white;
}
#admin-chat-form button:hover {
    background-color: #2a79fc;
}

/* --- END of NEW Admin Styles --- */

/* --- NEW Style for Blog Post Image in Admin Table --- */
.blog-post-image-preview {
    width: 100px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e5e9f2;
}
/* --- END of NEW Style --- */

/* New Admin Panel Styles */
#admin-panel {
    text-align: left;
    background-color: #f8f9fa;
    border-radius: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
    border: none;
    box-shadow: none;
    width: 100%;
    height: 100vh; /* Changed from calc to fill whole screen */
    display: flex; /* Make admin panel a flex container */
    flex-direction: column; /* Stack header and container */
}

.admin-header {
    background-color: #ffffff;
    padding: 1.5rem 2.5rem;
    border-bottom: 1px solid #e5e9f2;
    flex-shrink: 0; /* Prevent header from shrinking */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header > div {
    flex-grow: 1;
}

.admin-header h2 {
    margin: 0 0 0.25rem 0;
    color: #2c3e50;
    font-size: 1.8rem;
}
.admin-header p {
    margin: 0;
    color: #7f8c8d;
    font-size: 1rem;
    display: block; /* Show subtitle */
}

.admin-container {
    display: flex;
    flex-grow: 1; /* Allow container to fill remaining space */
    overflow: hidden; /* Manage scrolling within children */
}

.admin-sidebar {
    width: 240px;
    background-color: #ffffff;
    border-right: 1px solid #e5e9f2;
    padding: 1.5rem 0;
    flex-shrink: 0;
    overflow-y: auto; /* Allow sidebar to scroll if its content is too tall */
    transition: width 0.3s ease; /* Transition for potential collapsing */
    display: flex; /* Use flexbox for footer */
    flex-direction: column; /* Stack nav and footer */
}

.admin-sidebar-footer {
    margin-top: auto; /* Pushes footer to the bottom */
    padding-top: 1rem;
    border-top: 1px solid #e5e9f2;
}

.admin-sidebar-footer .admin-nav-link {
    color: #e74c3c;
}
.admin-sidebar-footer .admin-nav-link:hover {
    background-color: #fdedec;
}
.admin-sidebar-footer .admin-nav-link.active { /* Should not happen, but for safety */
    border-left-color: #e74c3c;
}

#admin-nav {
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Allow nav to take available space */
}

.admin-nav-link {
    padding: 0.9rem 2.5rem;
    color: #526476;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    border-left: 4px solid transparent;
    transition: all 0.2s ease-in-out;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.admin-nav-link:hover {
    background-color: #f8f9fa;
    color: #3D8BFD;
}

.admin-nav-link.active {
    background-color: #eaf3fe;
    color: #3D8BFD;
    font-weight: 700;
    border-left-color: #3D8BFD;
}

/* NEW: Inline admin nav link */
.admin-nav-link-inline {
    color: #3D8BFD;
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
}
.admin-nav-link-inline:hover {
    text-decoration: underline;
}

.admin-main-content {
    flex-grow: 1;
    padding: 2.5rem;
    background-color: #f8f9fa;
    overflow-y: auto; /* Enable vertical scrolling for the main content area */
    height: 100vh; /* Make it take full viewport height to enable its own scrollbar */
}

.admin-section {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

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

.admin-section h3 {
    font-size: 1.6rem;
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #dde2e7;
}

.admin-section-description {
    font-size: 1rem;
    color: #526476;
    max-width: 800px;
    line-height: 1.6;
    margin-top: -1.5rem;
    margin-bottom: 2.5rem;
}

.admin-section-header-with-button {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: -2.5rem; /* Adjust based on parent padding to stick to the very top */
    background-color: #f8f9fa; /* Match admin content background */
    padding: 1.5rem 0; /* Adjust padding */
    z-index: 20;
    border-bottom: 1px solid #dde2e7;
    margin: -2.5rem -2.5rem 2rem -2.5rem;
    padding-left: 2.5rem;
    padding-right: 2.5rem;
}

.admin-section-header-with-button h3 {
    margin: 0;
    padding: 0;
    border: none;
}

/* NEW: Style for content stats in admin panel */
.content-stats {
    background-color: #fff;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    border: 1px solid #e5e9f2;
    margin-bottom: 2rem;
    display: inline-block;
    box-shadow: 0 4px 10px rgba(44,62,80,0.05);
}

.content-stats .stat-item h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    color: #7f8c8d;
    font-weight: 500;
    text-transform: uppercase;
}

.content-stats .stat-item p {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1;
}

.admin-section-header-with-button .header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.view-switcher {
    display: flex;
    background-color: #eef1f4;
    border-radius: 8px;
    padding: 4px;
    border: 1px solid #dde2e7;
}

.view-switch-btn {
    background: transparent;
    border: none;
    padding: 0.5rem 0.8rem;
    cursor: pointer;
    color: #7f8c8d;
    font-size: 1rem;
    border-radius: 6px;
    line-height: 1;
    transition: all 0.2s ease-in-out;
}

.view-switch-btn:hover {
    color: #34495e;
    background-color: #e5e9f2;
    transform: none;
    box-shadow: none;
}

.view-switch-btn.active {
    background-color: #fff;
    color: #3D8BFD;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.admin-section-header-with-button .stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.5rem;
    border: 1px solid #e5e9f2;
    border-radius: 8px;
    background-color: #f8f9fa;
}

/* --- NEW and UPDATED Voice Management Styles --- */
#admin-voices-section > p {
    font-size: 1rem;
    color: #526476;
    max-width: 800px;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.api-source-display {
    background-color: #eaf3fe;
    border: 1px solid #c1d9fb;
    color: #2a79fc;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    box-shadow: 0 2px 4px rgba(61,139,253,0.1);
}

.api-source-display .api-label {
    font-weight: 500;
    color: #34495e;
}

.api-source-display strong {
    font-weight: 700;
}

#voice-management-board {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

#voice-management-table-container {
    background-color: #fff;
    border-radius: 12px;
    border: 1px solid #e5e9f2;
    overflow: hidden; /* For rounded corners */
    box-shadow: 0 4px 10px rgba(44,62,80,0.05);
}

#voice-management-table {
    width: 100%;
    border-collapse: collapse;
}

#voice-management-table th,
#voice-management-table td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid #eef1f4;
    vertical-align: middle;
}

#voice-management-table th {
    background-color: #f8f9fa;
    font-size: 0.85rem;
    color: #7f8c8d;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

#voice-management-table tbody tr:last-child td {
    border-bottom: none;
}

#voice-management-table tbody tr:hover {
    background-color: #f8f9fa;
}

.voice-table-name {
    font-weight: 700;
    color: #34495e;
}
.voice-table-id {
    font-size: 0.8rem;
    color: #95a5a6;
    font-family: 'Courier New', Courier, monospace;
    display: block;
    margin-top: 4px;
}

.status-badge {
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
}

.status-badge.connected {
    background-color: #2ecc71;
}

.status-badge.gratis { background-color: #3498db; }
.status-badge.registrado { background-color: #9b59b6; }
.status-badge.premium { background-color: #f39c12; }

.voice-management-column {
    flex: 1;
    background-color: #eef1f4;
    border-radius: 12px;
    padding: 0.75rem;
    border: 1px solid #dde2e7;
}

.column-header {
    padding: 1rem 1.2rem;
    margin: 0 0 1rem 0;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.column-header.gratis {
    background: linear-gradient(135deg, #2980b9, #3498db);
    color: white;
}

.column-header.registrado {
    background: linear-gradient(135deg, #8e44ad, #9b59b6);
    color: white;
}

.column-header.premium {
    background: linear-gradient(135deg, #f39c12, #f1c40f);
    color: white;
}

.column-header.api-source {
    background: linear-gradient(135deg, #526476, #7f8c8d);
    color: white;
}

.voice-count {
    font-size: 0.9rem;
    font-weight: 700;
    background-color: rgba(0,0,0,0.15);
    padding: 0.3rem 0.7rem;
    border-radius: 15px;
}

.voice-management-list {
    min-height: 400px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.voice-management-item {
    background-color: #fff;
    border: 1px solid #dde2e7;
    border-radius: 8px;
    padding: 0.8rem 1rem;
    cursor: grab;
    transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    box-shadow: 0 2px 4px rgba(44,62,80,0.06);
}

.voice-management-item:hover {
    box-shadow: 0 5px 12px rgba(44,62,80,0.12);
    transform: translateY(-2px);
    border-color: #3D8BFD;
}

.voice-management-item .voice-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.voice-management-item .voice-name {
    font-weight: 700;
    color: #34495e;
    font-size: 0.95rem;
    display: block;
}

.voice-management-item .voice-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.voice-management-item .voice-lang {
    font-size: 0.85rem;
    color: #526476;
}

.voice-management-item .voice-id-detail {
    font-size: 0.75rem;
    color: #95a5a6;
    font-family: 'Courier New', Courier, monospace;
}

.voice-management-item .voice-gender-symbol {
    font-size: 1.5rem;
    line-height: 1;
    flex-shrink: 0;
    width: 28px;
    text-align: center;
    opacity: 0.8;
}

.voice-management-item .drag-handle {
    color: #bdc3c7;
    font-size: 1.8rem;
    line-height: 1;
    cursor: grab;
    font-weight: bold;
    align-self: center;
    padding: 0 0.5rem;
}
.voice-management-item .drag-handle:hover {
    color: #34495e;
}

.admin-voice-play-btn {
    background-color: #ecf0f1;
    color: #34495e;
    border: 1px solid transparent;
    width: 36px;
    height: 36px;
    font-size: 1rem;
    line-height: 1;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
    margin-left: auto;
}

.admin-voice-play-btn:hover {
    background-color: #3D8BFD;
    color: #fff;
    transform: scale(1.1);
}

.admin-voice-play-btn.playing {
    background-color: #e74c3c;
    color: #fff;
}

.admin-voice-play-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.sortable-ghost {
    opacity: 0.4;
    background-color: #c8ebfb;
    border: 2px dashed #3D8BFD;
}

.sortable-chosen {
    cursor: grabbing;
}

.tooltip-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    background-color: #95a5a6;
    color: white;
    border-radius: 50%;
    font-size: 13px;
    line-height: 18px;
    text-align: center;
    font-weight: bold;
    font-family: sans-serif;
    cursor: help;
    margin-left: 6px;
    vertical-align: middle;
    transition: background-color 0.2s;
}

.tooltip-icon:hover {
    background-color: #34495e;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background-color: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #e5e9f2;
    transition: all 0.2s ease-in-out;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(44,62,80,0.1);
    border-color: #3D8BFD;
}

.stat-card h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    color: #7f8c8d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card p {
    margin: 0;
    font-size: 2.2rem;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.1;
}

.stat-note {
    font-size: 0.8rem;
    color: #95a5a6;
    font-weight: 500;
}

.stat-icon {
    font-size: 2.5rem;
    padding: 0.5rem;
    border-radius: 10px;
    line-height: 1;
}
.stat-icon.users { background-color: #eaf3fe; color: #3D8BFD; }
.stat-icon.premium { background-color: #fef5e7; color: #f39c12; }
.stat-icon.revenue { background-color: #e8f8f5; color: #1abc9c; }
.stat-icon.churn { background-color: #fdedec; color: #e74c3c; }
.stat-icon.tts { background-color: #f4ecf7; color: #9b59b6; }
.stat-icon.url-shortener { background-color: #e8f8f5; color: #1abc9c; }
.stat-icon.screen-recorder { background-color: #fdedec; color: #e74c3c; }

.admin-widgets-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.user-stats-bar {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    background-color: #fff;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    border: 1px solid #e5e9f2;
}
.user-stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.user-stat-item .stat-label {
    font-size: 0.85rem;
    color: #7f8c8d;
    text-transform: uppercase;
    font-weight: 600;
}
.user-stat-item .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
}

.user-management-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    align-items: center;
}

.user-management-controls .search-wrapper {
    position: relative;
    flex-grow: 1;
}

.user-management-controls .search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #95a5a6;
    font-size: 0.9rem;
}

#user-search-input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.5rem; /* Add padding for icon */
    border-radius: 8px;
    border: 1px solid #dde2e7;
    font-size: 0.95rem;
    background-color: #fff;
    box-sizing: border-box;
    transition: all 0.2s;
}

#user-search-input:focus {
    outline: none;
    border-color: #3D8BFD;
    box-shadow: 0 0 0 3px rgba(61,139,253,.15);
}

#user-filter-select {
    padding: 0.8rem 1rem;
    border-radius: 8px;
    border: 1px solid #dde2e7;
    font-size: 0.95rem;
    background-color: #fff;
    cursor: pointer;
    min-width: 200px;
}
#user-filter-select:focus {
    outline: none;
    border-color: #3D8BFD;
}

.user-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.admin-table-container.users-table {
    background-color: #fff;
    border: 1px solid #e5e9f2;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(44,62,80,0.05);
    overflow: hidden;
}

#users-table {
    width: 100%;
    border-collapse: collapse;
}

#users-table th, #users-table td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid #eef1f4;
    vertical-align: middle;
}

#users-table th {
    background-color: #f8f9fa;
    font-size: 0.8rem;
    color: #7f8c8d;
    text-transform: uppercase;
    font-weight: 600;
}

#users-table tbody tr:last-child td {
    border-bottom: none;
}

#users-table tbody tr:hover {
    background-color: #f8f9fa;
}

.user-info-cell {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-card-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-card-info .user-card-name {
    font-weight: 700;
    color: #34495e;
    margin: 0;
    font-size: 0.95rem;
}

.user-card-info .user-card-email {
    font-size: 0.85rem;
    color: #7f8c8d;
    margin: 0.2rem 0 0 0;
}

.user-card-joined {
    font-size: 0.9rem;
    color: #526476;
}

.user-card-plan {
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    color: white;
    text-transform: capitalize;
}
.user-card-plan.free {
    background-color: #3498db;
}
.user-card-plan.premium {
    background-color: #f39c12;
}
.user-card-plan.tts { background-color: #9b59b6; }
.user-card-plan.url { background-color: #1abc9c; }
.user-card-plan.screen { background-color: #e74c3c; }

.user-card-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.actions-cell {
    text-align: right !important;
}

.user-card-actions .admin-action-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-card-actions .delete-user-btn {
    background-color: #fdedec;
    color: #c0392b;
    border-color: #f5b7b1;
}
.user-card-actions .delete-user-btn:hover {
    background-color: #e74c3c;
    color: white;
}

.admin-widget {
    background-color: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #e5e9f2;
    margin-bottom: 1.5rem;
}

.admin-widget h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    color: #34495e;
}

.admin-widget textarea {
    width: 100%;
    min-height: 80px;
    border-radius: 8px;
    border: 1px solid #dde2e7;
    padding: 0.8rem;
    font-family: inherit;
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
    resize: vertical;
    transition: all 0.2s;
}

.admin-widget textarea:focus {
    outline: none;
    border-color: #3D8BFD;
    box-shadow: 0 0 0 3px rgba(61,139,253,.15);
}

.admin-input, .admin-textarea, .admin-select {
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    border: 1px solid #dde2e7;
    background-color: #fdfdfd;
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit; /* Ensure select inherits font */
}
.admin-input, .admin-textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #dde2e7;
    border-radius: 8px;
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: #fdfdfd;
}

.admin-input:focus, .admin-textarea:focus, .admin-select:focus {
    outline: none;
    border-color: #3D8BFD;
    box-shadow: 0 0 0 3px rgba(61,139,253,.15);
}

.admin-textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

/* --- NEW: System Settings Tab Styles --- */
.settings-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #dde2e7;
    overflow-x: auto;
    padding-bottom: 4px;
}

.settings-tab-btn {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    background-color: transparent;
    color: #526476;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    border-radius: 8px 8px 0 0;
}

.settings-tab-btn:hover {
    background-color: #f0f3f5;
    color: #34495e;
    transform: none;
    box-shadow: none;
}

.settings-tab-btn.active {
    color: #3D8BFD;
    border-bottom-color: #3D8BFD;
}
/* --- END: System Settings Tab Styles --- */

.settings-group {
    background-color: #ffffff;
    border: 1px solid #e5e9f2;
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 4px 10px rgba(44,62,80,0.05);
    display: none; /* Hide by default */
    animation: fadeIn 0.4s ease-out;
}

.settings-group.active {
    display: block; /* Show only the active group */
}

.settings-group-header {
    font-size: 1.3rem;
    color: #34495e;
    margin: 0 0 1.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    border-bottom: 1px solid #dde2e7;
    padding-bottom: 1rem;
}

.setting-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.setting-card {
    background-color: #fff;
    border-radius: 12px;
    border: 1px solid #e5e9f2;
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 4px 10px rgba(44,62,80,0.05);
}

.setting-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(44,62,80,0.1);
}

.setting-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    border-bottom: 1px solid #eef1f4;
}

.setting-card-icon {
    font-size: 1.8rem;
    background-color: #f4f7f9;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.setting-card-title h5 {
    margin: 0 0 0.2rem 0;
    font-size: 1.1rem;
    color: #2c3e50;
}

.setting-card-title p {
    margin: 0;
    font-size: 0.9rem;
    color: #7f8c8d;
    line-height: 1.4;
}

.setting-card-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    flex-grow: 1;
}

.setting-card-body small {
    font-size: 0.85rem;
    color: #7f8c8d;
    margin-top: -0.5rem;
    display: block;
}

.form-group-enhanced {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group-enhanced label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #526476;
}
/* --- END: New and Updated Styles for System Settings Section --- */

.form-group-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #f0f3f5;
}

.form-group-toggle.maintenance-toggle {
    background-color: #fef9e7;
    border-color: #fbeee0;
}

.form-group-toggle label:first-child {
    flex-grow: 1;
    cursor: pointer;
    padding-right: 1rem;
}

.toggle-label-title {
    font-weight: 700;
    color: #34495e;
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

.toggle-label-desc {
    font-size: 0.85rem;
    color: #7f8c8d;
    line-height: 1.4;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
    flex-shrink: 0;
}

.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: #2ecc71;
}

.maintenance-toggle input:checked + .slider {
    background-color: #e67e22;
}

input:focus + .slider {
    box-shadow: 0 0 1px #2ecc71;
}

input:checked + .slider:before {
    transform: translateX(22px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

.setting-group {
    background-color: #ffffff;
    border: 1px solid #e5e9f2;
    border-radius: 12px;
    padding: 1.5rem 2rem;
    box-shadow: 0 4px 10px rgba(44,62,80,0.05);
    display: none; /* Hide by default */
    animation: fadeIn 0.4s ease-out;
}

.setting-group.active {
    display: block; /* Show only the active group */
}

.setting-group-header {
    font-size: 1.3rem;
    color: #34495e;
    margin: 0 0 1.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    border-bottom: 1px solid #dde2e7;
    padding-bottom: 1rem;
}

.plan-actions {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eef1f4;
    text-align: right;
}

.admin-action-btn {
    background-color: #ecf0f1;
    color: #34495e;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    display: inline-block;
    border: 1px solid #dde2e7;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

.admin-action-btn:hover {
    background-color: #e0e5e8;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(44,62,80,0.08);
}

.admin-action-btn.connect {
    background-color: #3D8BFD;
    color: white;
    border-color: #3D8BFD;
}
.admin-action-btn.connect:hover {
    background-color: #2a79fc;
}

.admin-action-btn.assign-plan {
    background-color: #eaf3fe;
    color: #3D8BFD;
    border-color: #c1d9fb;
}

.admin-action-btn.assign-plan:hover {
    background-color: #3D8BFD;
    color: white;
}

.admin-action-btn.view {
    background-color: #2ecc71;
    color: white;
    border-color: #27ae60;
}

.admin-action-btn.view:hover {
    background-color: #27ae60;
}

.gateway-integration-card {
    background-color: #fff;
    border-radius: 12px;
    border: 1px solid #e5e9f2;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    text-align: left;
}

.gateway-logo {
    height: 40px;
    width: auto;
    flex-shrink: 0;
}

.gateway-info {
    flex-grow: 1;
}

.gateway-info h5 {
    margin: 0 0 0.2rem 0;
    font-size: 1.1rem;
    color: #34495e;
}

.gateway-info p {
    margin: 0;
    color: #526476;
    font-size: 0.9rem;
}

.gateway-action {
    flex-shrink: 0;
}

.admin-section-group {
    margin-bottom: 2.5rem;
}
.admin-section-group h4 {
    font-size: 1.2rem;
    color: #34495e;
    margin-bottom: 1rem;
}

.plan-management-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.plan-card {
    background-color: #fff;
    border: 1px solid #e5e9f2;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 10px rgba(44,62,80,0.05);
    display: flex;
    flex-direction: column;
}

.plan-header {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eef1f4;
}

.plan-header h5 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    color: #34495e;
}

.plan-price {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2c3e50;
}

.price-period {
    font-size: 0.9rem;
    font-weight: 500;
    color: #7f8c8d;
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1;
}

.plan-features li {
    margin-bottom: 0.7rem;
    color: #526476;
    font-size: 0.95rem;
    line-height: 1.4;
}

.admin-action-btn:hover {
    background-color: #e0e5e8;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(44,62,80,0.08);
}

.add-new-plan {
    border-style: dashed;
    border-width: 2px;
    border-color: #bdc3c7;
    background-color: #f8f9fa;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    justify-content: center;
    align-items: center;
    box-shadow: none;
}
.add-new-plan:hover {
    border-color: #3D8BFD;
    background-color: #eaf3fe;
    color: #3D8BFD;
}
.add-new-plan-content {
    text-align: center;
    color: #7f8c8d;
    transition: color 0.2s;
}
.add-new-plan:hover .add-new-plan-content {
    color: #3D8BFD;
}
.add-new-plan .add-icon {
    font-size: 2.5rem;
    font-weight: 300;
    line-height: 1;
    margin-bottom: 0.5rem;
}
.add-new-plan span {
    font-weight: 700;
    font-size: 1rem;
}

/* --- Footer --- */
.main-footer {
    padding: 2.5rem 2rem;
    margin-top: 3rem;
    background-color: #2c3e50;
    color: #bdc3c7;
    text-align: center;
    font-size: 0.9rem;
    line-height: 1.5;
}

.footer-content-wrapper {
    max-width: 800px;
    margin: 0 auto 1.5rem auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.footer-social-links {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.social-icon {
    display: block;
    width: 40px;
    height: 40px;
    background-size: 60%;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 50%;
    background-color: #34495e;
    transition: background-color 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #fff;
    text-decoration: none;
}

.social-icon:hover {
    transform: scale(1.1);
}

.social-icon.twitter {
    background-color: #1DA1F2;
}
.social-icon.twitter:hover { background-color: #1DA1F2; }

.social-icon.facebook {
    background-color: #1877F2;
}
.social-icon.facebook:hover { background-color: #1877F2; }

.social-icon.instagram {
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%,#d6249f 60%,#285AEB 90%);
}
.social-icon.instagram:hover { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%,#d6249f 60%,#285AEB 90%); }

.main-footer .footer-links {
    margin: 0;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.main-footer .footer-links a {
    color: #ecf0f1;
    text-decoration: none;
    transition: color 0.2s;
}

.main-footer .footer-links a:hover {
    color: #3D8BFD;
    text-decoration: underline;
}

.main-footer p {
    margin: 0;
}

/* --- Screen Recorder Page Styles --- */
.recorder-container .site-description { /* site-description inside recorder-container */
    max-width: 100%;
}

.recorder-header h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    background: none;
    -webkit-text-fill-color: unset;
}

.recorder-header p {
    font-size: 1.1rem;
    color: #526476;
    margin-top: -1rem;
    margin-bottom: 2rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.video-preview-container {
    width: 100%;
    background-color: #f4f7f9;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border: 2px dashed #dde2e7;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.3s;
}

.video-preview-container:has(#video-preview:not(.hidden)) {
    border-style: solid;
    border-color: #3D8BFD;
}

#video-preview {
    width: 100%;
    height: 100%;
    display: block;
    background-color: #000;
}

#preview-placeholder {
    color: #7f8c8d;
    text-align: center;
    padding: 2rem;
}

#preview-placeholder i {
    font-size: 4rem;
    color: #bdc3c7;
    margin-bottom: 1rem;
}

#preview-placeholder p {
    font-size: 1.1rem;
    color: #526476;
    margin: 0 0 0.5rem 0;
    font-weight: 500;
}

.recorder-layout-flex {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.recorder-preview-area {
    flex-grow: 1;
    width: 100%;
}

.recorder-settings {
    flex: 0 0 300px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 0;
    border: 1px solid #e5e9f2;
}

.recorder-container .setting-group {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    min-width: unset;
    flex: 1;
    text-align: left;
}

/* --- NEW: Blog Filter Styles --- */
.blog-filter-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

.blog-filter-btn {
    padding: 0.7rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    border: 2px solid #dde2e7;
    border-radius: 30px;
    background-color: transparent;
    color: #526476;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.blog-filter-btn:hover {
    background-color: #f0f3f5;
    border-color: #c8ced3;
    transform: translateY(-2px);
    box-shadow: none;
}

.blog-filter-btn.active {
    background-color: #3D8BFD;
    color: white;
    border-color: #3D8BFD;
    box-shadow: 0 4px 10px rgba(61,139,253,0.2);
}

/* --- Blog Page Styles --- */
.blog-container, .article-container {
    max-width: 900px;
    margin: 4rem auto;
    padding: 2rem;
    background-color: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(44, 62, 80, 0.08);
}

.blog-header {
    text-align: center;
    margin-bottom: 3rem;
    border-bottom: 1px solid #e5e9f2;
    padding-bottom: 1.5rem;
}

.blog-header h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    background: none; /* remove gradient for static pages */
    -webkit-text-fill-color: unset;
}

.blog-header p {
    font-size: 1.1rem;
    color: #526476;
    max-width: 600px;
    margin: 0 auto;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.blog-post-card {
    background-color: #fdfdfd;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e5e9f2;
    box-shadow: 0 4px 10px rgba(44,62,80,0.05);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.blog-post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(44,62,80,0.1);
    border-color: #3D8BFD;
}

.blog-post-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.blog-post-card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.blog-post-card h3 {
    margin: 0 0 0.8rem 0;
    font-size: 1.3rem;
    color: #34495e;
}

.blog-post-card p {
    margin: 0 0 1.5rem 0;
    color: #526476;
    line-height: 1.6;
    flex-grow: 1;
}

.read-more-btn {
    display: inline-block;
    background-color: #3D8BFD;
    color: white;
    padding: 0.7rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    text-align: center;
    transition: background-color 0.2s;
    align-self: flex-start;
}

.read-more-btn:hover {
    background-color: #2a79fc;
}

/* --- Article Page Styles --- */
.article-container {
    max-width: 800px;
}

.article-header {
    text-align: center;
    margin-bottom: 2rem;
}

.article-header .article-image {
    width: 100%;
    max-height: 350px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.article-header h1 {
    font-size: 2.2rem;
    line-height: 1.3;
    color: #2c3e50;
    margin: 0 0 0.5rem 0;
}

.article-meta {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 2rem;
}

.article-content {
    color: #34495e;
    line-height: 1.8;
    font-size: 1.1rem;
}

.article-content h2 {
    font-size: 1.6rem;
    color: #2c3e50;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #3D8BFD;
}

.article-content p {
    margin-bottom: 1.5rem;
}

.article-content ul {
    padding-left: 25px;
    margin-bottom: 1.5rem;
}

.article-content li {
    margin-bottom: 0.8rem;
}

.article-content a {
    color: #3D8BFD;
    font-weight: 700;
    text-decoration: none;
}
.article-content a:hover {
    text-decoration: underline;
}

.article-content blockquote {
    border-left: 4px solid #3D8BFD;
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: #526476;
    background-color: #f4f7f9;
    padding-top: 1rem;
    padding-bottom: 1rem;
    border-radius: 0 8px 8px 0;
}

.back-to-blog-link {
    display: inline-block;
    margin-top: 3rem;
    color: #3D8BFD;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
}
.back-to-blog-link:hover {
    text-decoration: underline;
}

/* Specific body styles for legal/static pages */
.static-page-body {
    background-color: #fff;
}

/* --- Cookie Consent Banner --- */
.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 1rem;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    z-index: 1050;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
    flex-wrap: wrap;
    text-align: center;
}

.cookie-consent-banner p {
    margin: 0;
}

.cookie-consent-banner a {
    color: #3D8BFD;
    text-decoration: underline;
}

#cookie-accept-btn {
    background-color: #2ecc71;
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    flex-shrink: 0;
}

#cookie-accept-btn:hover {
    background-color: #27ae60;
    transform: none; /* Override general button hover */
    box-shadow: none;
}

/* --- Responsive Design --- */
@media (max-width: 992px) {
    .admin-nav-toggle {
        display: block;
    }

    .admin-container {
        flex-direction: column;
        overflow: visible; /* Allow content to scroll normally */
        height: auto;
    }

    .admin-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: 300px;
        max-width: 85%;
        height: 100%;
        background-color: #ffffff;
        z-index: 1100;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        box-shadow: 5px 0 25px rgba(0,0,0,0.1);
        border-right: 1px solid #e5e9f2;
        padding: 0;
    }

    .admin-sidebar.active {
        transform: translateX(0);
    }
    
    .admin-sidebar-header {
        display: flex;
    }

    #admin-nav {
        padding-top: 1rem;
    }

    .main-nav .nav-auth {
        /* Hide auth buttons from the nav bar itself, they will be inside the slide-out menu */
        display: none;
    }

    .nav-toggle {
        display: block;
    }

    .nav-links-container {
        position: fixed;
        top: 0;
        right: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.215, 0.61, 0.355, 1);
        z-index: 1001;
    }
    .nav-links-container.active {
        transform: translateX(0);
    }
    
    .nav-links {
        flex-direction: column;
        gap: 1.5rem;
        width: 100%;
        text-align: center;
    }
    
    .nav-links a {
        font-size: 1.5rem;
        font-weight: 700;
        padding: 0.5rem 1rem;
        justify-content: center;
    }

    .dropdown:hover .dropdown-menu {
        display: none; /* Disable hover on mobile */
    }
    .dropdown.active .dropdown-menu {
        display: block;
        opacity: 1;
        visibility: visible;
        position: static;
        transform: none;
        box-shadow: none;
        background-color: transparent;
        border: none;
        padding: 0.5rem 0 0 0;
        margin-top: 1rem;
        min-width: unset;
        text-align: center;
    }

    .dropdown-menu li a {
        font-size: 1.1rem;
        font-weight: 500;
        padding: 0.5rem 1rem;
        color: #526476;
    }
    
    .dropdown.active .dropdown-icon {
        transform: rotate(180deg);
    }

    .nav-links-container .nav-auth-mobile {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        margin-top: 2rem;
        padding-top: 2rem;
        border-top: 1px solid #e5e9f2;
        width: 80%;
        max-width: 300px;
        align-items: stretch;
    }

    .nav-auth-mobile button {
        padding: 0.8rem 1.5rem;
        width: 100%;
    }

    .nav-auth-mobile .user-display {
        font-size: 1.2rem;
        justify-content: center;
    }
    
    #admin-panel {
        height: auto;
    }

    .admin-main-content {
        height: auto; /* Revert to natural height */
        overflow-y: visible; /* Revert to natural scroll */
        padding: 1.5rem;
    }

    #voice-management-board {
        flex-direction: column;
    }

    /* Admin Chat Responsive */
    .admin-chat-view {
        position: relative; /* Changed to relative */
        flex-direction: row; /* Keep as row to allow side-by-side sliding */
        overflow: hidden; /* Hide the overflow */
        height: auto;
        min-height: 70vh;
    }
    .admin-chat-sidebar {
        width: 100%; /* Take full width */
        border-right: none;
        max-height: none;
        flex-shrink: 0; /* Important for sliding */
        transition: transform 0.3s ease-in-out;
        position: static; /* Revert sticky position inside chat view on mobile */
        height: auto;
        overflow-y: visible;
    }
    
    .admin-chat-sidebar.inactive {
        transform: translateX(-100%);
    }

    .admin-chat-user-list {
        flex-grow: 1;
        overflow-y: auto;
    }

    .admin-chat-main {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: #fff;
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
        z-index: 10;
        display: flex;
        flex-direction: column;
    }

    .admin-chat-main.active {
        transform: translateX(0);
    }
    
    #admin-chat-conversation-view {
        display: flex; /* Make sure it's flex for children */
        flex-direction: column; /* Ensure vertical layout */
        flex-grow: 1;
    }
    .conversation-header {
        flex-shrink: 0; /* Prevent header from shrinking */
        gap: 0.5rem;
        padding-left: 1rem;
        padding-right: 1rem;
    }
    .conversation-back-btn {
        display: block; /* Show on mobile */
    }

}

@media (max-width: 768px) {
    /* Responsive Tables to Cards */
    .admin-table-container table, 
    .admin-table-container thead, 
    .admin-table-container tbody, 
    .admin-table-container th, 
    .admin-table-container td, 
    .admin-table-container tr {
        display: block;
    }

    .admin-table-container thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    .admin-table-container tr {
        margin-bottom: 1rem;
        border: 1px solid #e5e9f2;
        border-radius: 8px;
        background: #fff;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
        padding: 0;
    }
    .admin-table-container.users-table tr { /* Reset padding for user table cards */
        padding: 0;
    }

    .admin-table-container td {
        border: none;
        border-bottom: 1px solid #eef1f4;
        position: relative;
        padding-left: 50%;
        text-align: right;
        min-height: 2.5em; /* ensure cells have some height */
        display: flex;
        align-items: center;
        justify-content: flex-end;
    }

    .admin-table-container td:last-child {
        border-bottom: 0;
    }
    
    .admin-table-container td::before {
        content: attr(data-label);
        position: absolute;
        left: 1rem;
        width: calc(50% - 2rem);
        text-align: left;
        font-weight: bold;
        color: #34495e;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .actions-cell, .user-card-actions {
        justify-content: flex-end;
        width: 100%;
    }

    .user-info-cell {
        padding-left: 1rem !important; /* Override the 50% */
        text-align: left;
    }
    .user-info-cell::before {
        display: none; /* No label needed for the main info cell */
    }

    /* End of Responsive Tables */

    body {
        -webkit-text-size-adjust: 100%;
    }

    main {
        padding: 1rem;
        margin: 1rem auto;
    }

    h1 {
        font-size: 2rem;
    }
    .subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    .site-description {
        font-size: 1rem;
        margin: -1rem auto 2rem auto;
    }
    
    .editor-card {
        padding: 1.5rem;
    }

    .editor-container {
       flex-direction: column;
    }

    .left-panel, .right-panel {
        min-width: 100%;
    }
    .voice-list {
        height: 300px;
    }

    .narration-controls {
        flex-direction: column;
        gap: 1.5rem;
    }
    .modal-content {
        padding: 2rem 1.5rem;
    }

    .admin-header {
        padding: 1rem 1.5rem;
    }
    .admin-header h2 {
        font-size: 1.5rem;
    }
    .admin-header p {
        display: none;
    }

    .admin-widgets-container {
        grid-template-columns: 1fr;
    }
    .user-management-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .header-content {
        padding: 0 1rem;
        flex-wrap: wrap; /* Allow header content to wrap */
        justify-content: center; /* Center when wrapped */
    }
    
    .main-header {
        padding: 0.75rem 0;
        margin-bottom: 1rem;
    }

    #login-indicator {
        display: none;
    }
    
    #chat-fab {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
        bottom: 15px;
        right: 15px;
    }
    
    #chat-widget {
        bottom: 75px;
        right: 15px;
    }
}

@media (max-width: 480px) {
    .admin-nav-link {
        padding: 0.7rem 0.8rem;
        font-size: 0.9rem;
    }
    .admin-widgets-container {
        grid-template-columns: 1fr;
    }
    .ai-text-tools .tool-buttons {
        grid-template-columns: 1fr;
    }
    .voice-filter-controls {
        flex-direction: row;
        gap: 0.5rem;
    }
    .voice-filter-container {
        gap: 0.5rem;
    }
    .voice-filter-group {
        padding: 0.3rem;
        flex-wrap: wrap;
    }
    .voice-filter-btn {
        flex: 1 1 48%;
        background-color: #f4f7f9;
        min-width: auto;
        padding: 0.7rem 0.5rem;
    }
    .voice-filter-btn.active {
        background-color: #fff;
        color: #3D8BFD;
        box-shadow: 0 2px 5px rgba(44,62,80,0.1);
    }
    
    .secondary-buttons {
        flex-direction: column;
        width: 100%;
    }
    .secondary-buttons button {
        width: 100%;
    }

    #chat-widget {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
        max-height: 100vh;
    }

    .recorder-layout-flex {
        flex-direction: column;
    }
}

#preview-placeholder p {
    font-size: 1.1rem;
    color: #526476;
    margin: 0 0 0.5rem 0;
    font-weight: 500;
}

.recorder-layout-flex {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.recorder-preview-area {
    flex-grow: 1;
    width: 100%;
}

.recorder-settings {
    flex: 0 0 300px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 0;
    border: 1px solid #e5e9f2;
}

.recorder-container .setting-group {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    min-width: unset;
    flex: 1;
    text-align: left;
}