body {
    font-family: 'Lato', sans-serif;
    background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
    background-size: 400% 400%;
    animation: gradient 15s ease infinite;
    margin: 0;
    min-height: 100vh;
    box-sizing: border-box;
    color: white;
    overflow-x: hidden;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
        overflow-y: auto;
    }
    
    .container {
        padding: 15px;
        margin: 0;
    }
    
    .wisdom-text {
        min-height: 80px;
        max-height: 300px;
        overflow-y: auto;
    }
    
    h1 {
        font-size: 2.5rem;
        margin-bottom: 20px;
    }
    
    .glow-button {
        padding: 10px 20px;
        font-size: 16px;
        margin: 5px;
    }
}

/* Loading Preloader */
.loading-preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.preloader-content {
    text-align: center;
    color: white;
    padding: 40px;
    background-color: rgba(26, 42, 108, 0.9);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: fadeInScale 0.3s ease-out;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.loading-text {
    font-size: 1.5rem;
    font-weight: 300;
    margin-top: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

/* Hide preloader in fullscreen mode */
.fullscreen-active .loading-preloader {
    display: none !important;
}

/* Welcome Screen */
.welcome-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.welcome-content {
    text-align: center;
    color: white;
    max-width: 600px;
    padding: 40px;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 1s ease-out;
}

.welcome-content h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.welcome-description {
    font-size: 1.2rem;
    line-height: 1.6;
    margin-bottom: 30px;
    opacity: 0.9;
}

.start-button {
    background: linear-gradient(45deg, #8a2be2, #fdbb2d);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.5rem;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(138, 43, 226, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.start-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(138, 43, 226, 0.6);
    background: linear-gradient(45deg, #9b30ff, #ffa500);
}

.start-button:active {
    transform: translateY(0);
}

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

/* Main Interface */
.main-interface {
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    box-sizing: border-box;
}

.main-interface .container {
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 15px;
    padding: 20px;
    max-width: 800px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    min-height: 100vh;
    box-sizing: border-box;
    margin: 0 auto;
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    font-weight: 300;
    font-size: 3rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.wisdom-section {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.status {
    font-size: 0.9rem;
    margin-bottom: 15px;
    color: #aaa;
}

.wisdom-text {
    font-size: 1.5rem;
    text-align: center;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.6;
    margin-bottom: 20px;
    font-style: italic;
}

.controls {
    display: flex;
    gap: 15px;
}

button {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

button:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}

.history-section {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 20px;
}

.settings-section.compact {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.interval-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 300px;
}

.interval-controls label {
    font-size: 1rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
}

.dual-slider {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dual-slider .slider {
    flex: 1;
    position: relative;
    z-index: 1;
}

.setting-item {
    margin-bottom: 15px;
}

.setting-item label {
    display: block;
    margin-bottom: 8px;
}

.slider {
    width: 100%;
    height: 5px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fdbb2d;
    cursor: pointer;
    transition: all 0.3s;
}

.slider::-webkit-slider-thumb:hover {
    background: #fff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fdbb2d;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
}

.slider::-moz-range-thumb:hover {
    background: #fff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.setting-feedback {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    margin-top: 5px;
    font-style: italic;
    opacity: 0.8;
}

.voice-settings {
    margin-top: 20px;
}

.service-settings {
    margin: 10px 0;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f9f9f9;
}

.toggle-container {
    display: flex;
    align-items: center;
    margin: 10px 0;
}

.toggle-container input[type="checkbox"] {
    margin-right: 10px;
}

.select-container {
    margin: 10px 0;
    display: flex;
    flex-direction: column;
}

.select-container label {
    margin-bottom: 5px;
    font-weight: bold;
}

.select-container select {
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background-color: white;
}

/* Disabled select styling */
select.disabled {
    opacity: 0.5;
    background-color: #f0f0f0;
    cursor: not-allowed;
}

.toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

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

.toggle-slider {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 34px;
    transition: 0.4s;
    margin-right: 10px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.4s;
}

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

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.toggle-label {
    font-size: 1rem;
}

.dropdown {
    width: 100%;
    padding: 8px 12px;
    border-radius: 5px;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    font-size: 1rem;
    margin-top: 5px;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23FFFFFF%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 12px top 50%;
    background-size: 12px auto;
}

.elevenlabs-settings {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
}

h2 {
    margin-top: 0;
    font-weight: 300;
    font-size: 1.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

#wisdom-history {
    max-height: 200px;
    overflow-y: auto;
    padding-right: 10px;
}

.history-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.history-time {
    font-size: 0.8rem;
    color: #aaa;
    margin-bottom: 5px;
}

.tts-tag {
    display: inline-block;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 12px;
    margin-left: 5px;
}

.elevenlabs-tag {
    background-color: #7934cf;
    color: white;
}

.openai-tag {
    background-color: #10a37f;
    color: white;
}

.history-text {
    font-size: 1rem;
}

select.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f0f0f0;
}

.toggle-container {
    margin-top: 15px;
}

.glow-button {
    background-color: #8a2be2;
    color: white;
    border: none;
    padding: 12px 24px;
    margin: 10px;
    border-radius: 30px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.5);
}

.glow-button:hover {
    background-color: #9b30ff;
    box-shadow: 0 0 20px rgba(138, 43, 226, 0.8);
    transform: scale(1.05);
}

.button-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

/* Полноэкранный режим */
.fullscreen-mode {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #121212;
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    transition: background 0.5s ease;
    cursor: none; /* Hide cursor in fullscreen mode */
    user-select: none; /* Prevent text selection */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Add a class for body when in fullscreen */
body.fullscreen-active {
    overflow: hidden;
}

/* Show cursor when moving mouse in fullscreen */
.fullscreen-mode:hover {
    cursor: auto;
}

.fullscreen-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 80%;
    height: 80%;
    max-width: 1200px;
    z-index: 1001;
}

#fullscreen-wisdom {
    font-size: 4rem;
    color: white;
    text-align: center;
    line-height: 1.6;
    margin-bottom: 40px;
    animation: fade-in 1s ease-in-out;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
    font-weight: 600;
    letter-spacing: 1px;
    padding: 40px;
    max-width: 90%;
    max-height: 90%;
    overflow-y: auto;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
    transform: scale(1);
    transition: transform 0.3s ease;
}

/* Scale effect on hover */
#fullscreen-wisdom:hover {
    transform: scale(1.02);
}

/* Fullscreen keyboard shortcut hint */
.fullscreen-hint {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background-color: rgba(0, 0, 0, 0.5);
    color: rgba(255, 255, 255, 0.6);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.fullscreen-mode:hover .fullscreen-hint {
    opacity: 1;
}

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

/* Mobile-specific adjustments */
@media (max-width: 768px) {
    .fullscreen-hint {
        display: none; /* Hide keyboard hints on mobile */
    }
    
    #fullscreen-wisdom {
        max-height: 70%; /* Reduce height on mobile for better fit */
    }
}

/* Music Player Styles */
.music-section {
    background-color: rgba(26, 42, 108, 0.8);
    border-radius: 20px;
    padding: 25px;
    margin: 20px 0;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.music-section h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.8rem;
    text-align: center;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.music-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.music-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 12px 24px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.music-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.music-btn:active {
    transform: translateY(0);
}

.music-btn.playing {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
}

.music-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 400px;
}

.current-track {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 10px 20px;
    font-size: 1rem;
    color: white;
    text-align: center;
    min-height: 20px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.volume-control label {
    font-size: 14px;
    color: #666;
}

.volume-control input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.volume-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.volume-control input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.music-btn.secondary {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    font-size: 0.9rem;
    padding: 8px 16px;
    margin-left: 10px;
}

.music-btn.secondary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.keyboard-hint {
    font-size: 12px;
    color: #888;
    margin-top: 8px;
    text-align: center;
    opacity: 0.8;
}

.keyboard-hint kbd {
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 3px;
    padding: 2px 6px;
    font-family: monospace;
    font-size: 11px;
    color: #333;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
