:root {
    /* Apple Dark Mode Colors */
    --primary-color: #0a84ff; /* Apple blue */
    --secondary-color: #5e5ce6; /* Apple indigo */
    --accent-color: #ff375f; /* Apple red */
    --background-color: #000000; /* Pure black background */
    --card-background: #1c1c1e; /* Dark card background */
    --elevated-background: #2c2c2e; /* Slightly lighter for elevated elements */
    --text-primary: #ffffff; /* White text */
    --text-secondary: #ebebf5; /* Light gray text with slight opacity */
    --text-tertiary: #8e8e93; /* Medium gray text */
    --border-color: #38383a; /* Subtle border color */
    --success-color: #30d158; /* Apple green */
    --warning-color: #ffd60a; /* Apple yellow */
    --error-color: #ff453a; /* Apple red */
    --gray-light: #3a3a3c;
    --gray-medium: #2c2c2e;
    --gray-dark: #1c1c1e;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Icons', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background-color);
    min-height: 100vh;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    overscroll-behavior: none;
    font-weight: 400;
}

.app-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 16px;
    width: 100%;
    box-sizing: border-box;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pages-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    width: 100%;
    display: flex;
    touch-action: pan-y;
}

.page {
    width: 100%;
    flex-shrink: 0;
    padding: 0 16px;
    overflow-y: auto;
    transition: transform 0.3s ease-out;
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    transform: translateX(100%);
    opacity: 0;
}

.page.active {
    transform: translateX(0);
    opacity: 1;
    z-index: 1;
}

header {
    text-align: center;
    margin-bottom: 1rem;
    padding: 1rem;
    display: flex;
    justify-content: center;
}

/* Navigation */
.main-nav {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-tertiary);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    background-color: var(--elevated-background);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.nav-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    color: var(--text-secondary);
}

.nav-link.active {
    background-color: var(--primary-color);
    color: var(--text-primary);
    box-shadow: 0 2px 10px rgba(10, 132, 255, 0.3);
}

/* Icons replacing headings */
.summary-icon, .notes-icon {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: block;
    text-align: center;
}

.empty-state {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 150px;
}

.empty-icon {
    font-size: 3rem;
    color: var(--text-tertiary);
    opacity: 0.5;
}

/* Recording section */
.record-button-container {
    position: fixed;
    bottom: 30px;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10;
}

/* Recording status */
.recording-status {
    color: #8e8e93;
    font-size: 14px;
    margin-bottom: 8px;
    text-align: center;
    font-weight: 500;
    transition: color 0.3s ease;
}

.recording .recording-status {
    color: #ff453a; /* Red color when recording */
    animation: pulse 1.5s infinite;
}

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

.record-button {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background-color: var(--accent-color);
    border: none;
    color: var(--text-primary);
    font-size: 1.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(255, 55, 95, 0.3);
    transition: all 0.3s ease;
    margin-bottom: 0.5rem;
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
}

.record-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.record-button.recording {
    background-color: var(--error-color);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    }
}

#recordingStatus {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.recording-timer {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--accent-color);
    visibility: hidden;
    font-variant-numeric: tabular-nums;
}

.recording-timer.active {
    visibility: visible;
}

/* Results section */
.results-section, .notes-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 100px; /* Add space for the fixed record button */
}

/* Notes list */
.notes-container {
    background-color: var(--card-background);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
}

.notes-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.note-item {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.2s ease;
    background-color: var(--elevated-background);
    margin-bottom: 1rem;
}

.note-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.note-number {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.1rem;
    font-variant-numeric: tabular-nums;
}

.note-date {
    color: var(--text-tertiary);
    font-size: 0.9rem;
    font-weight: 300;
}

.delete-note-btn {
    background: none;
    border: none;
    color: var(--error-color);
    cursor: pointer;
    font-size: 1rem;
    padding: 0.25rem;
    transition: all 0.2s ease;
}

.delete-note-btn:hover {
    transform: scale(1.1);
}

.note-summary, .note-transcription {
    margin-bottom: 1rem;
}

/* Icon positioning in notes */
.note-summary .summary-icon {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    margin-bottom: 0.5rem;
}

.note-transcription .collapsible-header {
    justify-content: center;
    gap: 1rem;
}

.summary-content {
    font-weight: 500;
}

.summary-container, .transcription-container {
    background-color: var(--card-background);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
}

/* Container headers */
.summary-container, .transcription-container, .notes-container {
    position: relative;
    padding-top: 3rem;
}

.summary-icon, .notes-icon, .collapsible-header .fa-align-left {
    position: absolute;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
}

.summary-content, .transcription-content {
    min-height: 100px;
}

.summary-content {
    font-weight: 500;
}

.bullet-point {
    margin-bottom: 24px;
    padding-left: 8px;
    position: relative;
    display: block;
    line-height: 1.5;
}

.bullet-point:last-child {
    margin-bottom: 0;
}

/* Collapsible sections */
.collapsible-header {
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    padding: 12px 0;
    user-select: none;
    color: var(--text-secondary);
    gap: 1rem;
}

.collapsible-header:hover {
    color: var(--primary-color);
}

.collapsible-header i {
    transition: transform 0.3s ease;
}

.collapsible-header.active i {
    transform: rotate(180deg);
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.collapsible-content.active {
    max-height: 1000px; /* Adjust as needed */
    transition: max-height 0.5s ease-in;
}

.placeholder {
    color: var(--text-tertiary);
    font-style: italic;
    font-weight: 300;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    border: 5px solid rgba(255, 255, 255, 0.1);
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

#loadingStatus {
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 500;
    text-align: center;
    max-width: 80%;
    padding: 0 20px;
}

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

/* Mobile optimization for loading overlay */
@media (max-width: 767px) {
    .loading-spinner {
        width: 50px;
        height: 50px;
    }
    
    #loadingStatus {
        font-size: 16px;
    }
}

/* Mobile optimizations */
@media (max-width: 767px) {
    .container {
        padding: 12px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .record-button {
        width: 72px;
        height: 72px;
        font-size: 1.8rem;
    }
    
    .main-nav {
        flex-direction: row;
        gap: 8px;
    }
    
    .nav-link {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    
    .summary-container, .transcription-container, .notes-container {
        padding: 1rem;
        margin-bottom: 2rem;
    }
    
    /* Enhanced note styling for mobile */
    .note-item {
        padding: 1.25rem !important;
        margin-bottom: 1.5rem !important;
        border: 1px solid var(--border-color) !important;
        border-radius: 12px !important;
        background-color: var(--elevated-background) !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
        display: block !important;
        width: 100% !important;
        clear: both !important;
    }
    
    /* Ensure notes have clear separation */
    .notes-list {
        display: flex !important;
        flex-direction: column !important;
        gap: 1.5rem !important;
        padding: 0.5rem !important;
    }
    
    /* Ensure note content is properly formatted */
    .note-summary, .note-transcription {
        margin-top: 1rem !important;
        padding-top: 0.75rem !important;
        border-top: 1px solid var(--border-color) !important;
    }
    
    /* Ensure note header has proper spacing */
    .note-header {
        margin-bottom: 0.75rem !important;
        padding-bottom: 0.5rem !important;
        border-bottom: 1px solid var(--border-color) !important;
    }
    
    /* Ensure collapsible content is properly styled */
    .collapsible-content {
        padding: 0.75rem !important;
        margin-top: 0.5rem !important;
        background-color: rgba(0, 0, 0, 0.2) !important;
        border-radius: 8px !important;
    }
}

/* Responsive design */
@media (min-width: 768px) {
    .results-section {
        flex-direction: row;
    }
    
    .summary-container, .transcription-container {
        flex: 1;
    }
    
    .summary-container {
        margin-right: 0.75rem;
    }
    
    .transcription-container {
        margin-left: 0.75rem;
    }
}
/* Pull-to-refresh styles */
.refresh-indicator {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(0);
    transition: transform 0.3s ease, opacity 0.3s ease;
    z-index: 5;
    pointer-events: none;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

.refresh-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 30px;
    height: 30px;
    margin-bottom: 5px;
}

.refresh-spinner i {
    color: #0a84ff;
    font-size: 20px;
    transition: transform 0.3s ease;
}

.refresh-text {
    font-size: 12px;
    color: #8e8e93;
    font-weight: 500;
}

.refreshing {
    transform: translateY(60px) !important;
    opacity: 1 !important;
}
