/* Base Styles and Variables */
:root {
    /* Dark Theme (Default) */
    --bg-primary: #121212;
    --bg-secondary: #1e1e1e;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --accent-color: #4f8cff;
    --accent-color-alt: #6a5acd;
    --glass-bg: rgba(30, 30, 30, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --neumorphic-shadow-dark: -5px -5px 10px rgba(40, 40, 40, 0.5);
    --neumorphic-shadow-light: 5px 5px 10px rgba(0, 0, 0, 0.5);
    --success-color: #4CAF50;
    --error-color: #f44336;
    --warning-color: #ff9800;
}

/* Light Theme Variables */
.light-mode {
    --bg-primary: #f5f5f7;
    --bg-secondary: #ffffff;
    --text-primary: #1d1d1f;
    --text-secondary: #6e6e73;
    --accent-color: #0071e3;
    --accent-color-alt: #5e5ce6;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
    --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    --neumorphic-shadow-dark: -5px -5px 10px rgba(255, 255, 255, 1);
    --neumorphic-shadow-light: 5px 5px 10px rgba(0, 0, 0, 0.1);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Ambient Background Animation */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 10% 20%, rgba(79, 140, 255, 0.05) 0%, transparent 50%),
                radial-gradient(circle at 90% 80%, rgba(106, 90, 205, 0.05) 0%, transparent 50%);
    z-index: -1;
    pointer-events: none;
}

.light-mode::before {
    background: radial-gradient(circle at 10% 20%, rgba(0, 113, 227, 0.03) 0%, transparent 50%),
                radial-gradient(circle at 90% 80%, rgba(94, 92, 230, 0.03) 0%, transparent 50%);
}

/* Glassmorphism Card Style */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
}

.glass-card:hover {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
}

.light-mode .glass-card:hover {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

/* Neumorphic Style */
.neumorphic {
    background: var(--bg-secondary);
    border-radius: 50%;
    box-shadow: var(--neumorphic-shadow-dark), var(--neumorphic-shadow-light);
    transition: all 0.2s ease;
}

.neumorphic:active {
    box-shadow: inset var(--neumorphic-shadow-dark), inset var(--neumorphic-shadow-light);
    transform: scale(0.97);
}

/* App Container */
.app-container {
    display: flex;
    flex-direction: column;
    max-width: 800px;
    min-height: 100vh;
    margin: 0 auto;
    padding: 1rem;
    position: relative;
}

/* Top Bar */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    margin-bottom: 1.5rem;
}

.logo {
    display: flex;
    align-items: center;
    font-weight: 700;
    font-size: 1.5rem;
}

.logo-icon {
    margin-right: 0.5rem;
    color: var(--accent-color);
    animation: pulse 2s infinite;
}

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

.theme-toggle button {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.theme-toggle button:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.light-mode .theme-toggle button:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Transcription Area */
.transcription-container {
    padding: 1.5rem;
    min-height: 150px;
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.transcription-area {
    width: 100%;
    min-height: 100px;
    font-size: 1.1rem;
    line-height: 1.6;
    position: relative;
}

.transcription-placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.cursor-effect {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background-color: var(--accent-color);
    margin-left: 2px;
    vertical-align: middle;
    animation: blink 1s infinite;
    opacity: 0;
}

.recording .cursor-effect {
    opacity: 1;
}

@keyframes blink {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

/* Mic Button */
.mic-button-container {
    display: flex;
    justify-content: center;
    margin: 1.5rem 0;
}

.mic-button {
    width: 80px;
    height: 80px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
}

.mic-button i {
    z-index: 2;
    transition: color 0.3s ease;
}

.mic-button:hover i {
    color: var(--accent-color);
}

.mic-button.recording i {
    color: #f44336;
}

.mic-waves {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    z-index: 1;
}

.mic-button:not(.recording) .mic-waves::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(79, 140, 255, 0.2) 0%, transparent 70%);
    animation: pulse-idle 2s infinite;
}

.mic-button.recording .mic-waves::before,
.mic-button.recording .mic-waves::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: rgba(244, 67, 54, 0.2);
    animation: recording-waves 2s infinite;
}

.mic-button.recording .mic-waves::after {
    animation-delay: 1s;
}

@keyframes pulse-idle {
    0% { width: 40%; height: 40%; opacity: 0.5; }
    50% { width: 60%; height: 60%; opacity: 0.3; }
    100% { width: 40%; height: 40%; opacity: 0.5; }
}

@keyframes recording-waves {
    0% { width: 40%; height: 40%; opacity: 0.5; }
    100% { width: 120%; height: 120%; opacity: 0; }
}

/* Notes Section */
.notes-section {
    margin-top: 2rem;
}

.section-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.notes-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.note-card {
    padding: 1rem;
    position: relative;
    transition: all 0.3s ease;
    animation: slide-in 0.3s ease-out;
    cursor: pointer;
}

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

.note-timestamp {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.note-preview {
    font-size: 0.95rem;
    line-height: 1.5;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    margin-bottom: 0.5rem;
}

.note-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.note-tag {
    background-color: rgba(79, 140, 255, 0.2);
    color: var(--accent-color);
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
}

.note-actions {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.note-card:hover .note-actions {
    opacity: 1;
}

.note-action-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.note-action-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.note-action-btn.edit:hover {
    color: var(--accent-color);
}

.note-action-btn.delete:hover {
    color: var(--error-color);
}

/* Bottom Navigation */
.bottom-nav {
    display: flex;
    justify-content: space-around;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--glass-border);
    padding: 0.8rem 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.nav-item {
    background: none;
    border: none;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

.nav-item i {
    font-size: 1.2rem;
    margin-bottom: 0.2rem;
}

.nav-item.active {
    color: var(--accent-color);
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.light-mode .nav-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Onboarding Tooltip */
.tooltip {
    position: fixed;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    padding: 1rem;
    z-index: 200;
    max-width: 300px;
    text-align: center;
    animation: fade-in 0.5s ease-out;
}

@keyframes fade-in {
    from { opacity: 0; transform: translate(-50%, 20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

.tooltip-content h3 {
    margin-bottom: 0.5rem;
    color: var(--accent-color);
}

.tooltip-content p {
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.tooltip-button {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.tooltip-button:hover {
    background-color: var(--accent-color-alt);
    transform: translateY(-2px);
}

/* Responsive Design */
@media (min-width: 768px) {
    .bottom-nav {
        display: none;
    }
    
    .mic-button {
        width: 100px;
        height: 100px;
        font-size: 2.2rem;
    }
    
    .transcription-container {
        min-height: 180px;
    }
}

@media (max-width: 767px) {
    .app-container {
        padding-bottom: 80px;
    }
    
    .notes-container {
        grid-template-columns: 1fr;
    }
}

/* Animations for Save Confirmation */
@keyframes save-confirmation {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.save-confirmation {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--success-color);
    color: white;
    padding: 1rem 2rem;
    border-radius: 30px;
    z-index: 300;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: save-confirmation 0.5s ease-out, fade-out 0.5s ease-out 1.5s forwards;
}

@keyframes fade-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Hidden by default */
#onboarding-tooltip {
    display: none;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.recording {
    animation: recording-pulse 2s infinite;
}

@keyframes recording-pulse {
    0% { box-shadow: 0 0 0 0 rgba(244, 67, 54, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(244, 67, 54, 0); }
    100% { box-shadow: 0 0 0 0 rgba(244, 67, 54, 0); }
}
