body {
    font-family: 'Roboto', sans-serif;
    background: #f5f5f7;
    color: #1d1d1f;
    line-height: 1.5;
}

.container {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 90%;
    position: relative;
}

h1 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 30px;
    text-align: center;
}

/* Enhanced Title */
.enhanced-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 30px;
    text-align: center;
    letter-spacing: 0.1em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.title-icon-left,
.title-icon-right {
    font-size: 1.8rem;
    opacity: 1;
    transition: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.title-icon-left {
    color: #000 !important;
    -webkit-text-fill-color: #000 !important;
}

.title-icon-right svg {
    width: 32px;
    height: 32px;
    margin-top: 4px;
}

/* Dark theme adjustments */
body.dark-theme .enhanced-title {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Record Button */
#recordButton {
    position: relative;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle at 30% 30%, #333 0%, #000 70%);
    display: flex;
    align-items: center;
    color: white;
    flex-direction: column;
    justify-content: center;
    border: none;
    padding: 12px;
    gap: 12px;
    border-radius: 50%;
    cursor: pointer;
    margin: 20px auto;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 
        inset 0 2px 4px rgba(255, 255, 255, 0.1),
        inset 0 -2px 4px rgba(0, 0, 0, 0.3),
        0 4px 8px rgba(0, 0, 0, 0.2);
}

#recordButton::before {
    content: '';
    position: absolute;
    inset: 0;
    left: -4px;
    top: -1px;
    margin: auto;
    width: 128px;
    height: 128px;
    border-radius: 50%;
    background: linear-gradient(-45deg, #e81cff 0%, #40c9ff 100%);
    z-index: -10;
    pointer-events: none;
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#recordButton::after {
    content: "";
    z-index: -1;
    position: absolute;
    inset: 0;
    background: linear-gradient(-45deg, #fc00ff 0%, #00dbde 100%);
    transform: translate3d(0, 0, 0) scale(0.95);
    filter: blur(20px);
}

#recordButton:hover::after {
    filter: blur(30px);
}

#recordButton:hover::before {
    transform: rotate(-180deg);
}

#recordButton:active::before {
    scale: 0.7;
}

#recordButton:hover {
    transform: scale(1.05);
}

/* Recording state */
#recordButton.recording {
    background: #ff0000 !important;
    animation: pulse 2s infinite;
}

#recordButton.recording::before {
    background: linear-gradient(-45deg, #ff1c1c 0%, #ff6b40 100%) !important;
}

#recordButton.recording::after {
    background: linear-gradient(-45deg, #ff0000 0%, #ff6b40 100%) !important;
}

/* Transcript containers */
.transcript-container,
.enhanced-transcript-container {
    position: relative;
    margin-top: 30px;
}

.copy-button {
    position: relative;
    top: auto;
    right: auto;
    padding: 8px 12px;
    background: #000000 !important;
    color: white !important;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    z-index: 1;
    margin-bottom: 10px;
    float: right;
    display: block;
    transition: all 0.3s ease;
}

/* Style for highlighted copy button */
.copy-button.highlight-copy {
    animation: highlight-pulse 2s ease-in-out;
    background: #ffd700 !important;
    color: black !important;
    box-shadow: 0 0 15px #ffd700;
    transform: scale(1.1);
}

/* Animation for highlighted copy button */
@keyframes highlight-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 5px #ffd700;
    }
    50% {
        transform: scale(1.2);
        box-shadow: 0 0 20px #ffd700;
    }
    100% {
        transform: scale(1.1);
        box-shadow: 0 0 15px #ffd700;
    }
}

.transcript-container::after,
.enhanced-transcript-container::after {
    content: "";
    display: table;
    clear: both;
}

/* Input styles */
.input {
    width: 100%;
    min-height: 120px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1rem;
    font-family: 'Roboto', sans-serif;
    background-color: #f8f9fa;
    color: #333;
    resize: vertical;
    transition: all 0.3s ease;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
    line-height: 1.5;
    overflow: hidden; /* Hide scrollbar during auto-expansion */
}

/* Auto-expanding text area styles */
.input.auto-expand {
    overflow-y: hidden;
    resize: none; /* Disable manual resize for auto-expanding areas */
}

.input:focus {
    outline: none;
    border-color: #ffd700;
    background-color: #f0f0f0;
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1);
}

textarea {
    font-family: 'Roboto', sans-serif;
    resize: vertical;
    min-height: 120px;
}

/* Button container */
.button-container {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 30px 0;
    flex-wrap: wrap;
}

/* Action buttons */
.action-button {
    position: relative;
    padding: 6px 24px; /* Reduced height by 50% - from 12px to 6px */
    background: #000;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    overflow: hidden;
    line-height: 1.4; /* Added to maintain text alignment in reduced height */
}

.action-button::before {
    content: '';
    position: absolute;
    inset: 0;
    left: -4px;
    top: -1px;
    margin: auto;
    width: calc(100% + 8px);
    height: calc(100% + 2px);
    border-radius: 8px;
    background: linear-gradient(-45deg, #e81cff 0%, #40c9ff 100%);
    z-index: -10;
    pointer-events: none;
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.action-button::after {
    content: "";
    z-index: -1;
    position: absolute;
    inset: 0;
    background: linear-gradient(-45deg, #fc00ff 0%, #00dbde 100%);
    transform: translate3d(0, 0, 0) scale(0.95);
    filter: blur(20px);
}

.action-button:hover::after {
    filter: blur(30px);
}

.action-button:hover::before {
    transform: rotate(-180deg);
}

.action-button:active::before {
    scale: 0.7;
}

.action-button:hover {
    transform: scale(1.05);
}

/* Pulse animation */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 28, 28, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 28, 28, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 28, 28, 0);
    }
}

/* Enhanced Mobile responsiveness */
@media (max-width: 767px) {
    .container {
        margin: 10px auto;
        padding: 18px;
        width: 95%;
        max-width: 100%;
        border-radius: 12px;
    }
    
    .enhanced-title {
        font-size: 1.8rem;
        gap: 10px;
        /* Preserve all desktop visual elements */
        font-weight: 700;
        letter-spacing: 0.1em;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }
    
    .title-icon-left,
    .title-icon-right {
        font-size: 1.5rem;
    }
    
    .title-icon-right svg {
        width: 24px;
        height: 24px;
    }
    
    .input {
        min-height: 150px; /* Increased height for mobile */
        padding: 14px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    textarea {
        min-height: 150px; /* Increased height for mobile */
    }
    
    .button-container {
        flex-direction: column;
        align-items: center;
        gap: 18px;
        margin: 25px 0;
    }
    
    .action-button {
        width: 100%;
        max-width: 320px;
        padding: 3px 24px; /* Very thin buttons for mobile */
        font-size: 16px;
        font-weight: 500;
        margin: 0;
        /* Preserve all desktop animations and effects */
        position: relative;
        background: #000;
        color: white;
        border: none;
        border-radius: 8px;
        cursor: pointer;
        transition: all 0.3s ease;
        overflow: hidden;
        line-height: 1.4;
    }
    
    /* Preserve button animations on mobile */
    .action-button::before {
        content: '';
        position: absolute;
        inset: 0;
        left: -4px;
        top: -1px;
        margin: auto;
        width: calc(100% + 8px);
        height: calc(100% + 2px);
        border-radius: 8px;
        background: linear-gradient(-45deg, #e81cff 0%, #40c9ff 100%);
        z-index: -10;
        pointer-events: none;
        transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }
    
    .action-button::after {
        content: "";
        z-index: -1;
        position: absolute;
        inset: 0;
        background: linear-gradient(-45deg, #fc00ff 0%, #00dbde 100%);
        transform: translate3d(0, 0, 0) scale(0.95);
        filter: blur(20px);
    }
    
    .action-button:hover::after {
        filter: blur(30px);
    }
    
    .action-button:hover::before {
        transform: rotate(-180deg);
    }
    
    .action-button:active::before {
        scale: 0.7;
    }
    
    .action-button:hover {
        transform: scale(1.05);
    }
    
    #recordButton {
        width: 108px;
        height: 108px;
        font-size: 0.9rem;
        /* Preserve all desktop visual effects */
        position: relative;
        background: radial-gradient(circle at 30% 30%, #333 0%, #000 70%);
        display: flex;
        align-items: center;
        color: white;
        flex-direction: column;
        justify-content: center;
        border: none;
        padding: 10px;
        gap: 8px;
        border-radius: 50%;
        cursor: pointer;
        margin: 15px auto;
        transition: all 0.3s ease;
        box-shadow: 
            inset 0 2px 4px rgba(255, 255, 255, 0.1),
            inset 0 -2px 4px rgba(0, 0, 0, 0.3),
            0 4px 8px rgba(0, 0, 0, 0.2);
    }
    
    #recordButton::before {
        content: '';
        position: absolute;
        inset: 0;
        left: -4px;
        top: -1px;
        margin: auto;
        width: 116px;
        height: 116px;
        border-radius: 50%;
        background: linear-gradient(-45deg, #e81cff 0%, #40c9ff 100%);
        z-index: -10;
        pointer-events: none;
        transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }
    
    #recordButton::after {
        content: "";
        z-index: -1;
        position: absolute;
        inset: 0;
        background: linear-gradient(-45deg, #fc00ff 0%, #00dbde 100%);
        transform: translate3d(0, 0, 0) scale(0.95);
        filter: blur(20px);
    }
    
    #recordButton:hover::after {
        filter: blur(30px);
    }
    
    #recordButton:hover::before {
        transform: rotate(-180deg);
    }
    
    #recordButton:active::before {
        scale: 0.7;
    }
    
    #recordButton:hover {
        transform: scale(1.05);
    }
    
    /* Recording state animations on mobile */
    #recordButton.recording {
        background: #ff0000 !important;
        animation: pulse 2s infinite;
    }
    
    #recordButton.recording::before {
        background: linear-gradient(-45deg, #ff1c1c 0%, #ff6b40 100%) !important;
    }
    
    #recordButton.recording::after {
        background: linear-gradient(-45deg, #ff0000 0%, #ff6b40 100%) !important;
    }
    
    .copy-button {
        padding: 10px 16px;
        font-size: 14px;
        margin-bottom: 12px;
    }
    
    #connectionStatus {
        width: 10px;
        height: 10px;
        top: 16px;
        right: 16px;
    }
    
    .theme-toggle {
        width: 40px;
        height: 40px;
        top: 80px;
        left: 16px;
        font-size: 1.3rem;
    }
    
    #timer {
        font-size: 1.1rem;
        margin-bottom: 12px;
    }
}

/* Small phone optimization */
@media (max-width: 380px) {
    .container {
        padding: 15px;
        width: 98%;
    }
    
    .enhanced-title {
        font-size: 1.5rem;
        gap: 8px;
    }
    
    .action-button {
        padding: 14px 20px;
        font-size: 14px;
    }
    
    #recordButton {
        width: 80px;
        height: 80px;
        margin: 15px auto;
    }
    
    #recordButton::before {
        width: 88px;
        height: 88px;
    }
}

/* Landscape mode optimization */
@media (max-height: 500px) and (orientation: landscape) {
    .container {
        margin: 5px auto;
        max-width: 95%;
    }
    
    .button-container {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
        margin: 15px 0;
    }
    
    .action-button {
        width: calc(50% - 10px);
        max-width: none;
        padding: 12px 15px;
    }
    
    #recordButton {
        width: 70px;
        height: 70px;
        font-size: 0.8rem;
        margin: 10px auto;
    }
    
    #recordButton::before {
        width: 78px;
        height: 78px;
    }
    
    .transcript-container,
    .enhanced-transcript-container {
        margin-top: 15px;
    }
    
    .input {
        min-height: 80px;
    }
    
    #timer {
        margin-bottom: 8px;
    }
}

/* Connection status */
.connection-status {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #FF3B30;
    z-index: 1000;
    transition: background-color 0.3s ease;
}

.connection-status.connected {
    background-color: #34C759;
}

.connection-status.connecting {
    background-color: #FF9500;
}

/* Dark theme */
body.dark-theme {
    background: #1c1c1e;
    color: #ffffff;
}

body.dark-theme #recordButton {
    background: radial-gradient(circle at 30% 30%, #8B2FF1 0%, #7110F1 70%);
    box-shadow: 
        inset 0 2px 4px rgba(255, 255, 255, 0.15),
        inset 0 -2px 4px rgba(0, 0, 0, 0.4),
        0 4px 8px rgba(0, 0, 0, 0.3);
}

body.dark-theme .copy-button {
    background: #7110F1 !important;
    color: white !important;
}

/* Dark theme version of highlighted copy button */
body.dark-theme .copy-button.highlight-copy {
    background: #ffd700 !important;
    color: black !important;
    box-shadow: 0 0 15px #ffd700;
}

body.dark-theme .input {
    background-color: #2c2c2e;
    color: #ffffff;
    border-color: #3a3a3c;
}

body.dark-theme .input:focus {
    border-color: #ffd700;
    background-color: #1c1c1e;
}

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

/* Theme toggle */
.theme-toggle {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    cursor: pointer;
    font-size: 1.5rem;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

body.dark-theme .container {
    background: #2c2c2e;
}

body.dark-theme textarea {
    background-color: #2c2c2e;
    color: #ffffff;
    border-color: #3a3a3c;
}

body.dark-theme .action-button {
    background: #7110F1;
}

body.dark-theme .action-button:hover {
    background: #8B2FF1;
}
