/* styles.css - Main stylesheet for all pages */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #1a2a6c, #b21f1f, #1a2a6c);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    margin: 0;
}

.container {
    width: 100%;
    height: 100vh;
    background-color: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Desktop layout - horizontal header */
.header {
    background: linear-gradient(to right, #2c3e50, #1a2a6c);
    color: white;
    padding: 10px 20px;
    text-align: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.header-brand {
    display: flex;
    flex-direction: column;
    text-align: left;
    min-width: 200px;
}

.header h1 {
    font-size: 22px;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.header h1 i {
    color: #4ecdc4;
}

.header p {
    opacity: 0.9;
    font-size: 13px;
    margin: 3px 0 0 0;
    text-align: left;
}

/* Navigation Styles */
.main-nav {
    margin: 0;
    flex: 1;
    min-width: 300px;
}

.main-nav ul {
    display: flex;
    justify-content: flex-end;
    list-style: none;
    flex-wrap: nowrap;
    gap: 5px;
    margin: 0;
    padding: 0;
}

.main-nav li {
    margin: 0 2px;
}

.main-nav a {
    color: #e0f7fa;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 13px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

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

.main-nav a i {
    font-size: 10px;
}

.content {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    width: 100%;
}

/* Welcome Screen Styles */
.welcome-container {
    width: 100%;
    max-width: 800px;
    text-align: center;
    display: none;
}

.home-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

.option-btn {
    background: linear-gradient(to right, #4ecdc4, #2a9d8f);
    color: white;
    border: none;
    padding: 20px;
    border-radius: 15px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    box-shadow: 0 5px 15px rgba(78, 205, 196, 0.3);
}

.option-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(78, 205, 196, 0.4);
}

/* Join Room Container (simplified) */
.join-room-container {
    width: 100%;
    max-width: 400px;
    text-align: center;
    display: none;
}

.join-room-title {
    font-size: 24px;
    margin-bottom: 30px;
    color: #2c3e50;
}

.join-room-form {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.join-room-form .form-group {
    margin-bottom: 25px;
    text-align: left;
}

.join-room-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 15px;
}

#room-code {
    width: 100%;
    padding: 15px;
    border: 2px dashed #4ecdc4;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    letter-spacing: 3px;
    outline: none;
    transition: border 0.3s;
}

#room-code:focus {
    border-style: solid;
    border-color: #2a9d8f;
}

.help-text {
    font-size: 13px;
    color: #7f8c8d;
    margin-top: 8px;
    font-style: italic;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.back-btn {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 15px 20px;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1;
}

.back-btn:hover {
    background: #7f8c8d;
    transform: translateY(-2px);
}

.join-btn {
    background: linear-gradient(to right, #4ecdc4, #2a9d8f);
    color: white;
    border: none;
    padding: 15px 20px;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 2;
}

.join-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(78, 205, 196, 0.4);
}

/* Setup Container Styles */
.setup-container {
    width: 100%;
    max-width: 500px;
    text-align: center;
    display: none;
}

.setup-title {
    font-size: 22px;
    margin-bottom: 25px;
    color: #2c3e50;
}

.setup-form {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 15px;
}

#username {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    transition: border 0.3s;
}

#username:focus {
    border-color: #4ecdc4;
}

.language-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.language-option, .language-option-partner {
    padding: 10px 15px;
    border-radius: 25px;
    background: #e3f2fd;
    color: #1a2a6c;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 90px;
    text-align: center;
    border: 2px solid transparent;
    font-size: 14px;
}

.language-option.active, .language-option-partner.active {
    background: #4ecdc4;
    color: white;
    border-color: #2a9d8f;
}

.start-btn {
    background: linear-gradient(to right, #4ecdc4, #2a9d8f);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 15px;
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(78, 205, 196, 0.4);
}

/* Language Dropdown Styles */
.language-dropdown {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    transition: border 0.3s;
    background: white;
    color: #333;
}

.language-dropdown:focus {
    border-color: #4ecdc4;
}

/* Disabled dropdown styles */
.language-dropdown:disabled {
    background-color: #f0f4f8;
    color: #7f8c8d;
    cursor: not-allowed;
    opacity: 0.8;
}

.language-dropdown:disabled option {
    color: #7f8c8d;
}

/* Have Code Section */
.have-code-section {
    margin-top: 25px;
    padding: 20px;
    background: #e3f2fd;
    border-radius: 10px;
    text-align: center;
}

.have-code-section p {
    margin: 0;
    color: #1a2a6c;
    font-size: 15px;
}

.have-code-section a {
    color: #4ecdc4;
    text-decoration: none;
    font-weight: 600;
}

.have-code-section a:hover {
    text-decoration: underline;
}

/* Room Container Styles */
.room-container {
    width: 100%;
    max-width: 500px;
    text-align: center;
    display: none;
}

.room-title {
    font-size: 22px;
    margin-bottom: 20px;
    color: #2c3e50;
}

.room-link {
    background: #f0f4f8;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.link-display {
    background: #e3f2fd;
    border: 1px dashed #4ecdc4;
    border-radius: 8px;
    padding: 12px;
    font-size: 15px;
    word-break: break-all;
    margin-bottom: 15px;
    color: #1a2a6c;
    font-weight: 500;
}

.copy-btn {
    background: #4ecdc4;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 30px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0 auto;
}

.copy-btn:hover {
    background: #3aa8a0;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(78, 205, 196, 0.4);
}

/* Room Code Sharing */
.room-code-share {
    background: #e3f2fd;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.room-code-share p {
    margin: 0 0 15px 0;
    color: #1a2a6c;
    font-size: 16px;
}

.room-code-share strong {
    font-size: 20px;
    color: #4ecdc4;
    letter-spacing: 2px;
}

.copy-code-btn {
    background: #4ecdc4;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 30px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 auto;
}

.copy-code-btn:hover {
    background: #3aa8a0;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(78, 205, 196, 0.4);
}

.status {
    margin-top: 15px;
    padding: 12px;
    border-radius: 10px;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.waiting {
    background: #fff8e1;
    color: #ff8f00;
}

.connected {
    background: #e8f5e9;
    color: #2e7d32;
}

/* Chat Container Styles */
.chat-container {
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
}

.chat-header {
    padding: 15px 20px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.chat-header-info {
    flex: 1;
}

.chat-header-name {
    font-weight: 600;
    font-size: 18px;
    margin-bottom: 3px;
}

.chat-header-status {
    font-size: 13px;
    color: #4ecdc4;
}

.end-chat-btn {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.end-chat-btn:hover {
    background: #ff5252;
    transform: translateY(-1px);
}

.messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f0f4f8;
    display: flex;
    flex-direction: column;
}

.message {
    max-width: 85%;
    padding: 12px 15px;
    margin-bottom: 15px;
    border-radius: 18px;
    position: relative;
    animation: fadeIn 0.3s ease;
    word-wrap: break-word;
    font-size: 15px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.received {
    align-self: flex-start;
    background: white;
    border-top-left-radius: 5px;
}

.sent {
    align-self: flex-end;
    background: #4ecdc4;
    color: white;
    border-top-right-radius: 5px;
}

.original-text {
    font-weight: 500;
    margin-bottom: 5px;
}

.translated-text {
    font-size: 14px;
    opacity: 0.9;
    font-style: italic;
}

.sent .translated-text {
    color: rgba(255, 255, 255, 0.9);
}

.message-time {
    font-size: 11px;
    text-align: right;
    margin-top: 6px;
    opacity: 0.7;
}

.message-input-area {
    padding: 15px;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.message-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 30px;
    padding: 12px 15px;
    font-size: 16px;
    outline: none;
    transition: border 0.3s;
}

.message-input:focus {
    border-color: #4ecdc4;
}

.send-button {
    background: #4ecdc4;
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    margin-left: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s;
}

.send-button:hover {
    background: #3aa8a0;
    transform: scale(1.05);
}

.timer {
    margin-top: 12px;
    font-size: 14px;
    color: #ff8f00;
}

.timer i {
    margin-right: 5px;
}

.message.system {
    align-self: center;
    background: #e3f2fd;
    color: #1a2a6c;
    font-style: italic;
    text-align: center;
    max-width: 90%;
    padding: 10px 15px;
    margin: 12px 0;
    border-radius: 18px;
    border-left: 4px solid #4ecdc4;
    font-size: 14px;
}

.message.system .message-time {
    color: #777;
    font-size: 11px;
    margin-top: 5px;
}

/* Footer Styles */
.main-footer {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 15px;
    margin-top: auto;
}

.footer-content {
    max-width: 100%;
    margin: 0 auto;
    text-align: center;
}

.footer-links {
    margin-bottom: 12px;
}

.footer-links a {
    color: #bdc3c7;
    text-decoration: none;
    margin: 0 10px;
    font-size: 13px;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #4ecdc4;
}

.footer-info p {
    font-size: 11px;
    color: #95a5a6;
    margin: 0;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.p-20 {
    padding: 20px;
}

.bg-light {
    background: #f8f9fa;
}

.rounded {
    border-radius: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 0;
        margin: 0;
    }
    
    .container {
        height: 100vh;
        border-radius: 0;
    }
    
    /* Tablet layout */
    .header {
        padding: 12px 15px;
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .header-brand {
        min-width: unset;
        text-align: center;
        align-items: center;
    }
    
    .header h1 {
        font-size: 20px;
        justify-content: center;
        gap: 6px;
    }
    
    .header p {
        text-align: center;
        font-size: 12px;
        margin: 3px 0 0 0;
    }
    
    .main-nav {
        min-width: unset;
        width: 100%;
        margin: 0;
    }
    
    .main-nav ul {
        justify-content: center;
        flex-wrap: wrap;
        gap: 3px;
    }
    
    .main-nav a {
        padding: 5px 10px;
        font-size: 11px;
        gap: 3px;
    }
    
    .main-nav a i {
        font-size: 9px;
    }
    
    .content {
        padding: 15px;
    }
    
    .setup-form {
        padding: 20px;
    }
    
    .setup-title {
        font-size: 20px;
    }
    
    .form-group label {
        font-size: 14px;
    }
    
    .language-selector {
        gap: 6px;
    }
    
    .language-option, .language-option-partner {
        padding: 8px 12px;
        font-size: 13px;
        min-width: 75px;
    }
    
    .start-btn {
        padding: 12px 20px;
        font-size: 15px;
    }
    
    .room-title {
        font-size: 20px;
    }
    
    .link-display {
        font-size: 14px;
        padding: 10px;
    }
    
    .copy-btn {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .status {
        font-size: 14px;
    }
    
    .chat-header {
        padding: 12px 15px;
    }
    
    .chat-header-name {
        font-size: 16px;
    }
    
    .chat-header-status {
        font-size: 12px;
    }
    
    .end-chat-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .message {
        font-size: 14px;
        max-width: 90%;
        padding: 10px 12px;
    }
    
    .translated-text {
        font-size: 13px;
    }
    
    .message-time {
        font-size: 10px;
    }
    
    .message-input {
        padding: 10px 12px;
        font-size: 15px;
    }
    
    .message-input-area {
        padding: 12px;
    }
    
    .send-button {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .footer-links a {
        display: block;
        margin: 8px 0;
        font-size: 12px;
    }
    
    .footer-info p {
        font-size: 10px;
    }
    
    .info-section {
        padding: 12px;
    }
    
    .info-section h3 {
        font-size: 16px;
    }
    
    .info-section p {
        font-size: 14px;
    }
    
    /* Room code sharing responsive */
    .room-code-share {
        padding: 15px;
    }
    
    .room-code-share p {
        font-size: 15px;
    }
    
    .room-code-share strong {
        font-size: 18px;
    }
    
    .copy-code-btn {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    /* Join room form responsive */
    .join-room-form {
        padding: 20px;
    }
    
    .join-room-title {
        font-size: 20px;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .back-btn, .join-btn {
        width: 100%;
    }
    
    #room-code {
        font-size: 16px;
        padding: 12px;
        letter-spacing: 2px;
    }
}

@media (max-width: 480px) {
    /* Mobile layout */
    .header h1 {
        font-size: 18px;
        gap: 5px;
    }
    
    .header p {
        font-size: 11px;
    }
    
    .main-nav ul {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .main-nav li {
        margin: 2px;
    }
    
    .main-nav a {
        padding: 4px 8px;
        font-size: 10px;
        gap: 2px;
    }
    
    .language-option, .language-option-partner {
        padding: 6px 10px;
        font-size: 12px;
        min-width: 65px;
    }
    
    .page-content {
        padding: 15px;
    }
    
    .page-content h1 {
        font-size: 18px;
    }
    
    .page-content h2 {
        font-size: 16px;
    }
    
    .page-content h3 {
        font-size: 15px;
    }
    
    .message {
        max-width: 95%;
    }
    
    /* Home options */
    .home-options {
        gap: 15px;
        max-width: 100%;
    }
    
    .option-btn {
        padding: 15px;
        font-size: 16px;
        gap: 10px;
    }
    
    /* Room code sharing */
    .room-code-share {
        padding: 12px;
    }
    
    .room-code-share p {
        font-size: 14px;
    }
    
    .room-code-share strong {
        font-size: 16px;
    }
    
    .copy-code-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
}

/* Footer Links Styles */
.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
    padding: 5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-links a {
    color: #bdc3c7;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.footer-links a:hover {
    color: #4ecdc4;
    transform: translateY(-2px);
}

.footer-links a i {
    font-size: 12px;
}

.footer-info p {
    font-size: 12px;
    color: #95a5a6;
    margin: 0;
    text-align: center;
}

/* Responsive adjustments for footer */
@media (max-width: 768px) {
    .footer-links {
        gap: 10px;
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .footer-links a {
        font-size: 12px;
        gap: 3px;
    }
    
    .footer-links a i {
        font-size: 10px;
    }
    
    .footer-info p {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .footer-links {
        gap: 8px;
    }
    
    .footer-links a {
        font-size: 11px;
    }
}