html {
    height: 100%;
}

body {
    margin: 0;
    padding: 0;
    padding-top: 50px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

header {
    height: 50px;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 30px;
    background-color: #4d4d4d;
}

header h1 {
    margin: 0;
    font-size: 1.5em;
    font-weight: bold;
}

header a {
    color: #ccc;
    text-decoration: none;
}

header a:hover {
    color: #a9a9a9;
}

header i {
    padding: 5px 5px;
    font-size: 2em;
}

main {
    flex: 1;
    padding: 20px;
}

#join {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
}

#join-dialog {
    width: 70%;
    max-width: 900px;
    padding: 60px;
    border-radius: 6px;
    background-color: #f0f0f0;
}

#join-dialog h2 {
    color: #4d4d4d;
    font-size: 60px;
    font-weight: bold;
    text-align: center;
}

#join-dialog form {
    text-align: left;
}

#join-dialog label {
    display: block;
    margin-bottom: 10px;
    color: #0088aa;
    font-weight: bold;
    font-size: 20px;
}

.form-control {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    box-sizing: border-box;
    color: #0088aa;
    font-weight: bold;
}

.form-control:focus {
    color: #0088aa;
    border-color: #0088aa;
    -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(0, 136, 170, 0.6);
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(0, 136, 170, 0.6);
}

#join-dialog button {
    display: block;
    margin: 20px auto 0;
}

.btn {
    font-weight: bold;
}

.btn-success {
    background-color: #06d362;
    border-color: #06d362;
}

.btn-success:hover {
    background-color: #1abd61;
    border-color: #1abd61;
}

#room {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#room-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1000px;
    padding: 0 20px;
    margin-bottom: 20px;
}

#room-title {
    font-size: 2em;
    font-weight: bold;
    margin: 0;
}

#layout-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 10px;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 1000px;
    height: 100%;
}

.video-container {
    position: relative;
    background: #3b3b3b;
    aspect-ratio: 16/9;
    border-radius: 6px;
    overflow: hidden;
}

.video-container video {
    width: 100%;
    height: 100%;
}

.video-container .participant-data {
    position: absolute;
    top: 0;
    left: 0;
}

.participant-data p {
    background: #f8f8f8;
    margin: 0;
    padding: 0 5px;
    color: #777777;
    font-weight: bold;
    border-bottom-right-radius: 4px;
}

footer {
    height: 60px;
    width: 100%;
    padding: 10px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #4d4d4d;
}

footer a {
    color: #ffffff;
    text-decoration: none;
}

footer .text {
    color: #ccc;
    margin: 0;
}

footer .text span {
    color: white;
    font-weight: bold;
}

#openvidu-logo {
    height: 35px;
    -webkit-transition: all 0.1s ease-in-out;
    -moz-transition: all 0.1s ease-in-out;
    -o-transition: all 0.1s ease-in-out;
    transition: all 0.1s ease-in-out;
}

#openvidu-logo:hover {
    -webkit-filter: grayscale(0.5);
    filter: grayscale(0.5);
}

/* Media Queries */
@media screen and (max-width: 768px) {
    header {
        padding: 10px 15px;
    }

    #join-dialog {
        width: 90%;
        padding: 30px;
    }

    #join-dialog h2 {
        font-size: 50px;
    }

    #layout-container {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }

    footer {
        padding: 10px 15px;
    }
}

@media screen and (max-width: 480px) {
    header {
        padding: 10px;
    }

    #join-dialog {
        width: 100%;
        padding: 20px;
    }

    #join-dialog h2 {
        font-size: 40px;
    }

    #layout-container {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .video-container {
        aspect-ratio: 9/16;
    }

    footer {
        padding: 10px;
    }
}

/* Login Overlay Styles */
#login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

#login-dialog {
    width: 100%;
    max-width: 400px;
    padding: 40px;
    border-radius: 15px;
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

#login-dialog h2 {
    color: #333;
    font-size: 28px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 10px;
}

.login-subtitle {
    color: #666;
    text-align: center;
    margin-bottom: 30px;
    font-size: 14px;
}

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

#login-form label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
    font-size: 14px;
}

.input-with-icon {
    position: relative;
}

.input-with-icon i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    z-index: 2;
}

.input-with-icon input {
    padding-left: 45px;
    padding-right: 45px;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    transition: all 0.3s ease;
    height: 45px;
}

.input-with-icon input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.show-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    z-index: 2;
}

.show-password:hover {
    color: #667eea;
}

.remember-me {
    margin-bottom: 20px;
}

.remember-me .form-check-input:checked {
    background-color: #667eea;
    border-color: #667eea;
}

#login-button {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    height: 45px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

#login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.error-message {
    color: #e74c3c;
    font-size: 14px;
    margin-bottom: 15px;
    text-align: center;
    min-height: 20px;
}

.login-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 12px;
    color: #777;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.login-footer p {
    margin: 0;
}

/* User info in header */
.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

#current-user {
    color: #fff;
    font-weight: 500;
}

/* Spinner for login button */
.spinner-border {
    vertical-align: middle;
}

/* App container animation */
#app-container {
    animation: slideUp 0.5s ease;
}

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

/* Responsive adjustments for login */
@media screen and (max-width: 480px) {
    #login-dialog {
        width: 90%;
        padding: 30px 20px;
        margin: 20px;
    }
    
    #login-dialog h2 {
        font-size: 24px;
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

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