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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #EFF3ED 0%, #A7BA81 100%);
    color: #2c3e50;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Login Page Styles */
.login-page {
    background: linear-gradient(135deg, #A7BA81 0%, #77C8A2 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    border: 1px solid #A7BA81;
}

.login-title {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #A2B947 0%, #77C8A2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-subtitle {
    text-align: center;
    color: #77C8A2;
    margin-bottom: 30px;
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 20px;
}

#password {
    width: 100%;
    padding: 15px;
    background: white;
    border: 2px solid #A7BA81;
    border-radius: 10px;
    color: #2c3e50;
    font-size: 1rem;
    transition: all 0.3s ease;
}

#password::placeholder {
    color: #A7BA81;
}

#password:focus {
    outline: none;
    border-color: #A2B947;
    background: white;
    box-shadow: 0 0 0 3px rgba(162, 185, 71, 0.1);
}

.login-button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #A2B947 0%, #77C8A2 100%);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.login-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(162, 185, 71, 0.3);
}

.login-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error-message {
    margin-top: 20px;
    padding: 10px;
    background: rgba(255, 67, 87, 0.2);
    border-radius: 8px;
    color: #ff4357;
    text-align: center;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.error-message:empty {
    display: none;
}

.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.login-footer {
    text-align: center;
    margin-top: 30px;
    color: #77C8A2;
    font-size: 0.9rem;
}

/* Recorder Page Styles */
.recorder-page {
    background: radial-gradient(ellipse at center, #EFF3ED 0%, #A7BA81 100%);
}

.recorder-container {
    width: 100%;
    max-width: 800px;
    padding: 20px;
}

.recorder-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.recorder-header h1 {
    font-size: 1.8rem;
    background: linear-gradient(135deg, #A2B947 0%, #77C8A2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logout-link {
    color: #A7BA81;
    text-decoration: none;
    transition: color 0.3s ease;
}

.logout-link:hover {
    color: #A2B947;
}

.recording-interface {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 25px;
    padding: 50px;
    backdrop-filter: blur(10px);
    border: 1px solid #A7BA81;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.recording-status {
    text-align: center;
    margin-bottom: 40px;
}

.timer {
    font-size: 3rem;
    font-weight: 300;
    font-variant-numeric: tabular-nums;
    letter-spacing: 2px;
    margin-bottom: 10px;
    color: #2c3e50;
}

.status-text {
    color: #77C8A2;
    font-size: 1.1rem;
}

/* Record Button with Heartbeat Animation */
.record-button-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin: 40px 0;
}

.record-button {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #A2B947 0%, #77C8A2 100%);
    border: none;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: white;
    box-shadow: 0 4px 20px rgba(162, 185, 71, 0.3);
}

.record-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(162, 185, 71, 0.4);
}

.record-button.recording {
    background: linear-gradient(135deg, #77C8A2 0%, #A7BA81 100%);
}

.heartbeat-circle {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid rgba(119, 200, 162, 0.5);
    animation: none;
}

.heartbeat-circle.active {
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.3;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.button-label {
    color: #77C8A2;
    font-size: 1.1rem;
    font-weight: 500;
}

/* Recording Controls */
.recording-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

.control-button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: white;
    border: 2px solid #A7BA81;
    border-radius: 10px;
    color: #2c3e50;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-button:hover {
    background: #EFF3ED;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.pause-btn:hover {
    border-color: #A2B947;
}

.restart-btn:hover {
    border-color: #A7BA81;
}

.stop-btn:hover {
    border-color: #77C8A2;
}

/* Audio Visualizer */
.audio-visualizer {
    margin-top: 40px;
    background: #EFF3ED;
    border-radius: 15px;
    padding: 20px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #A7BA81;
}

#visualizerCanvas {
    width: 100%;
    height: 100px;
    border-radius: 10px;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    border: 2px solid #A7BA81;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.modal-content h2 {
    margin-bottom: 20px;
    font-size: 1.8rem;
    color: #2c3e50;
}

.modal-content p {
    color: #77C8A2;
    margin-bottom: 30px;
    line-height: 1.6;
}

#emailInput {
    width: 100%;
    padding: 15px;
    background: white;
    border: 2px solid #A7BA81;
    border-radius: 10px;
    color: #2c3e50;
    font-size: 1rem;
    margin-bottom: 30px;
}

#emailInput::placeholder {
    color: #A7BA81;
}

#emailInput:focus {
    outline: none;
    border-color: #A2B947;
    box-shadow: 0 0 0 3px rgba(162, 185, 71, 0.1);
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.modal-button {
    padding: 12px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-button.primary {
    background: linear-gradient(135deg, #A2B947 0%, #77C8A2 100%);
    color: white;
}

.modal-button.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(162, 185, 71, 0.3);
}

.modal-button.secondary {
    background: white;
    color: #2c3e50;
    border: 2px solid #A7BA81;
}

.modal-button.secondary:hover {
    background: #EFF3ED;
}

/* Success Message */
.success-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 25px;
    padding: 50px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 2px solid #A7BA81;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.success-icon {
    font-size: 5rem;
    animation: successPulse 1s ease-in-out;
}

@keyframes successPulse {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.success-container h2 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #2c3e50;
}

.success-container p {
    color: #77C8A2;
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Processing Overlay */
.processing-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.processing-content {
    text-align: center;
}

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

.processing-content p {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
}

/* Responsive Design */
@media (max-width: 768px) {
    .recorder-container {
        padding: 10px;
    }

    .recording-interface {
        padding: 30px 20px;
    }

    .timer {
        font-size: 2.5rem;
    }

    .record-button {
        width: 100px;
        height: 100px;
    }

    .modal-content {
        padding: 30px 20px;
    }

    .recording-controls {
        flex-direction: column;
        width: 100%;
    }

    .control-button {
        width: 100%;
        justify-content: center;
    }
}