* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background-image: url('../assets/background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: #333;
    height: 100vh;
    overflow: hidden;
}

/* Welcome Screen */
.welcome-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.welcome-screen.active {
    opacity: 1;
    pointer-events: all;
}

.welcome-content {
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.logo {
    width: 80px; /* Made slightly larger since it's now centered */
    height: auto;
    margin-right: 0; /* Removed right margin since there's no text next to it */
}

.welcome-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #333;
}

.welcome-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #444;
}

.welcome-content p {
    font-size: 1rem;
    margin-bottom: 30px;
    color: #666;
}

.welcome-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 30px;
}

.primary-button {
    background-color: #003382;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

.primary-button:hover {
    background-color: #002561;
}

.secondary-button {
    background-color: transparent;
    color: #003382;
    border: 2px solid #003382;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.secondary-button:hover {
    background-color: rgba(0, 51, 130, 0.1);
}

.welcome-footer {
    font-size: 0.8rem;
    color: #888;
}

/* App Container */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 1000px;
    margin: 0 auto;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.app-container.active {
    opacity: 1;
    pointer-events: all;
}

.app-header {
    display: flex;
    justify-content: flex-end; /* Changed from space-between to flex-end */
    align-items: center;
    padding: 15px 20px;
}

.connect-btn, .disconnect-btn {
    padding: 8px 16px;
    border-radius: 20px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.connect-btn {
    background-color: #003382;
    color: white;
}

.connect-btn:hover {
    background-color: #002561;
}

.disconnect-btn {
    background-color: #ff4b4b;
    color: white;
}

.disconnect-btn:hover {
    background-color: #e04141;
}

.header-controls {
    display: flex;
    gap: 10px;
}

.action-btn {
    background-color: transparent;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.action-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    margin-bottom: 20px;
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    line-height: 1.5;
}

.user-message {
    background-color: #DCF8C6;
    margin-left: auto;
    border-bottom-right-radius: 5px;
}

.ai-message {
    background-color: #F2F2F2;
    margin-right: auto;
    border-bottom-left-radius: 5px;
}

.message-meta {
    font-size: 0.7rem;
    color: #888;
    margin-top: 5px;
    text-align: right;
}

.app-footer {
    display: flex;
    align-items: center;
    padding: 15px;
}

.text-input-container {
    flex-grow: 1;
    display: flex;
    margin-right: 10px;
    background-color: white;
    border-radius: 25px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.text-input {
    flex-grow: 1;
    border: none;
    padding: 12px 15px;
    font-size: 1rem;
    outline: none;
}

.send-btn {
    background-color: transparent;
    border: none;
    padding: 0 15px;
    font-size: 1.2rem;
    cursor: pointer;
    color: #003382;
}

.mic-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background-color: #003382;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.mic-btn:hover {
    background-color: #002561;
}

.mic-btn.active {
    background-color: #ff4b4b;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.visualizer {
    position: absolute;
    bottom: 85px;
    left: 0;
    width: 100%;
    height: 50px;
    opacity: 0;
    transition: opacity 0.3s;
}

.visualizer.active {
    opacity: 1;
}

/* Updated Flip Card Styling */
.flip-card-container {
    position: fixed;
    top: calc(50% - 15px);
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    perspective: 1000px;
    z-index: 2000;
}

.flip-card {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.flip-card.flipped {
    transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible; /* Allow the wave effect to go beyond boundaries */
}

.flip-card-back {
    transform: rotateY(180deg);
}

/* Audio wave border animations - Listening state */
.flip-card.listening .flip-card-front::after,
.flip-card.listening .flip-card-back::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid rgba(0, 51, 130, 0.7);
    z-index: -1;
    animation: wave-border-listening 3s ease-in-out infinite;
}

/* Audio wave border animations - Speaking state */
.flip-card.speaking .flip-card-front::after,
.flip-card.speaking .flip-card-back::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid rgba(255, 75, 75, 0.7);
    z-index: -1;
    animation: wave-border-speaking 1.5s ease-in-out infinite;
}

/* Wave animations for listening state */
@keyframes wave-border-listening {
    0% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
    50% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }
    100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
}

/* Wave animations for speaking state */
@keyframes wave-border-speaking {
    0% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
    25% {
        border-radius: 40% 60% 50% 50% / 30% 60% 40% 70%;
    }
    50% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }
    75% {
        border-radius: 50% 50% 40% 60% / 70% 30% 60% 40%;
    }
    100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
}

/* Remove any conflicting animations */
.flip-card.listening, 
.flip-card.speaking {
    animation: none;
}

/* Interview Summary Screen - WITH MATCHING WELCOME SCREEN STYLE */
.interview-summary {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../assets/background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.interview-summary.active {
    opacity: 1;
    pointer-events: auto;
}

.summary-content {
    width: 90%;
    max-width: 700px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.summary-content h2 {
    color: #003382;
    font-size: 28px;
    margin-bottom: 24px;
    position: relative;
}

.summary-content h2:after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: #003382;
    border-radius: 3px;
}

.summary-stats {
    display: flex;
    justify-content: space-between;
    margin: 40px 0;
}

.stat-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    color: #003382;
    margin-bottom: 8px;
}

.stat-label {
    color: #666;
    font-size: 16px;
}

.summary-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin: 32px 0;
}

.summary-btn {
    background-color: rgba(0, 51, 130, 0.1);
    color: #003382;
    border: 1px solid #003382;
    padding: 14px 20px;
    border-radius: 50px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-weight: 600;
}

.summary-btn:hover {
    background-color: rgba(0, 51, 130, 0.2);
}

.summary-content .primary-button {
    margin-top: 24px;
}

/* Settings Dialog */
.settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 3000;
    display: none;
}

.settings-overlay.active {
    display: block;
}

.settings-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 600px;
    background-color: white;
    border-radius: 20px;
    padding: 30px;
    z-index: 3001;
    max-height: 90vh;
    overflow-y: auto;
    display: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.settings-dialog.active {
    display: block;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.settings-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
}

.close-settings {
    background-color: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #777;
}

.settings-section {
    margin-bottom: 25px;
}

.settings-section h4 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: #444;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: #555;
}

.form-group select,
.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    background-color: white;
}

.form-group textarea {
    height: 100px;
    resize: vertical;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.slider-container input[type="range"] {
    flex-grow: 1;
}

.slider-value {
    width: 50px;
    text-align: right;
    font-size: 0.9rem;
    color: #555;
}

.collapsible-toggle {
    background-color: #f5f5f5;
    border: none;
    width: 100%;
    text-align: left;
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    color: #444;
    cursor: pointer;
    margin-bottom: 10px;
    transition: background-color 0.3s;
}

.collapsible-toggle:hover {
    background-color: #eee;
}

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

.collapsible-content.active {
    max-height: 1000px;
    padding-top: 10px;
    padding-bottom: 20px;
}

.settings-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* Toast Notification */
.toast-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #003382;
    color: white;
    padding: 12px 25px;
    border-radius: 50px;
    font-size: 0.9rem;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    z-index: 5000;
    animation: fadeInOut 3s forwards;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translate(-50%, 20px); }
    15% { opacity: 1; transform: translate(-50%, 0); }
    85% { opacity: 1; transform: translate(-50%, 0); }
    100% { opacity: 0; transform: translate(-50%, -20px); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .summary-stats {
        flex-direction: column;
        gap: 15px;
    }
    
    .settings-dialog {
        padding: 20px;
    }
}

/* Question Manager Styles */
.questions-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.8);
}

.question-item {
    padding: 10px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s;
}

.question-item:last-child {
    border-bottom: none;
}

.question-item:hover {
    background-color: rgba(0, 51, 130, 0.05);
}

.question-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.question-number {
    font-weight: 600;
    color: #003382;
}

.question-text {
    color: #333;
}

.question-condition {
    color: #0066cc;
    font-size: 0.9em;
    font-style: italic;
}

.question-type {
    background-color: rgba(0, 51, 130, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    align-self: flex-start;
    color: #003382;
}

.question-actions {
    display: flex;
    gap: 8px;
}

.question-actions button {
    padding: 4px 12px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s;
}

.edit-question {
    background-color: #f2f2f2;
    color: #333;
}

.delete-question {
    background-color: #ffeeee;
    color: #cc0000;
}

.edit-question:hover {
    background-color: #e0e0e0;
}

.delete-question:hover {
    background-color: #ffcccc;
}

.no-questions {
    padding: 20px;
    text-align: center;
    color: #666;
}

/* Question Editor Modal Styles */
.question-editor-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 3000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.question-editor-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 600px;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.2);
    z-index: 3001;
    overflow: hidden;
}

.question-editor-content {
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.question-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
}

.question-editor-header h3 {
    margin: 0;
    color: #003382;
}

.close-editor {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #666;
    padding: 0;
    line-height: 1;
}

.question-editor-body {
    padding: 20px;
    overflow-y: auto;
}

.question-editor-footer {
    padding: 15px 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

#questionText {
    min-height: 100px;
}

.helper-text {
    display: block;
    font-size: 0.8em;
    color: #666;
    margin-top: 4px;
}

/* Make sure existing form group styles apply */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-family: 'Poppins', sans-serif;
}