/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #1e1e1e;
    color: #dcdcdc;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* Container */
.container {
    display: flex;
    flex: 1;
    height: calc(100vh - 50px); /* Adjust for footer height */
}

/* Sidebar */
.sidebar {
    background-color: #333;
    width: 220px;
    display: flex;
    flex-direction: column;
    padding: 10px;
    color: #dcdcdc;
    box-shadow: 2px 0 5px rgba(0,0,0,0.3);
}

.logo {
    font-size: 20px;
    margin-bottom: 20px;
}

.file-explorer {
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* File Buttons */
.file-btn {
    background-color: #444;
    border: none;
    padding: 10px;
    margin-bottom: 5px;
    color: #dcdcdc;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s;
    display: flex;
}

.file-btn:hover {
    background-color: #555;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background-color: #333;
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.btn {
    background-color: #007acc;
    color: #fff;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
}

.btn:hover {
    background-color: #005a9e;
    transform: scale(1.05);
}

/* Editor Container */
.editor-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    border-top: 1px solid #444;
    position: relative;
}

.editor-header {
    background-color: #2c2c2c;
    color: #dcdcdc;
    padding: 10px;
    text-align: center;
    font-weight: bold;
    border-bottom: 1px solid #444;
}

.editor {
    flex: 1;
    border: 1px solid #444;
    border-radius: 5px;
    background-color: #1e1e1e;
}

.result-frame {
    flex: 1;
    border: 1px solid #444;
    border-radius: 5px;
    background-color: #444;
    width: 100%;
    height: 100%;
}

.result-frame.fullscreen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

/* Footer */
.footer {
    background-color: #333;
    color: #dcdcdc;
    padding: 10px;
    text-align: center;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.3);
    flex-shrink: 0;
}

.footer a {
    color: #dcdcdc;
    margin: 0 10px;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

h4 {
    font-family: var(--Playfair);
    text-align: center;
    font-weight: 500;
    font-size: 1.3rem;
    color: whitesmoke;
  }  

/* Media Queries */
@media screen and (max-width: 1200px) {
    .editor-container {
        flex-direction: column;
    }
}

@media screen and (max-width: 768px) {
    .sidebar {
        width: 180px;
    }

    .file-btn {
        padding: 8px;
    }

    .header {
        padding: 8px;
    }

    .btn {
        padding: 8px 12px;
    }
}

@media screen and (max-width: 480px) {
    .sidebar {
        width: 150px;
    }

    .file-btn {
        padding: 6px;
    }

    .header {
        padding: 6px;
    }

    .btn {
        padding: 6px 10px;
    }

    .logo {
        font-size: 15px;
    }
}

@media screen and (max-width: 320px) {
    .sidebar {
        width: 120px;
    }

    .file-btn {
        padding: 5px;
    }

    .header {
        padding: 5px;
    }

    .btn {
        padding: 5px 8px;
    }
}

/* Ensure footer is visible on small screens */
@media screen and (max-height: 480px) {
    .container {
        height: calc(100vh - 40px);
    }

    .footer {
        padding: 5px;
    }
}

@media screen and (orientation: landscape) {
    .editor-container {
        flex-direction: row;
    }
}

/* Coder AI button specific style */
.coder-ai-btn {
    background-color: #841ad4; /* Orange color to differentiate */
    color: #fff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 15px;
    border-radius: 5px;
    transition: background-color 0.3s, transform 0.3s;
}

.coder-ai-btn:hover {
    background-color: #6a3fae;
    transform: scale(1.05);
}

/* Header responsive adjustments */
@media screen and (max-width: 768px) {
    .header {
        flex-wrap: wrap;
        gap: 5px;
    }
    .btn, .coder-ai-btn {
        padding: 8px 10px;
        font-size: 14px;
    }
}

@media screen and (max-width: 480px) {
    .header {
        flex-direction: column;
        gap: 5px;
    }
    .btn, .coder-ai-btn {
        padding: 6px 8px;
        font-size: 12px;
    }
}

@media screen and (max-width: 320px) {
    .btn, .coder-ai-btn {
        padding: 5px 6px;
        font-size: 11px;
    }
}

