@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@100..900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Outfit", sans-serif;
    scroll-behavior: smooth;
    font-weight: 400;
    letter-spacing: 1px;
    -webkit-tap-highlight-color: transparent;
}

body {
    width: 100%;
    height: 100%;
    font-weight: 400;
    scroll-behavior: smooth;
    color: #CCCCCC;
    background-color: #1A1A1A;
    -webkit-tap-highlight-color: transparent;
}

header {
    text-align: center;
    padding: 1rem;
}

header h1 {
    color: #FFFFFF;
    font-weight: 500;
    font-size: 2.5rem;
    margin-top: 4rem;
    margin-bottom: 1rem;
}

header p {
    font-size: 1rem;
    margin-bottom: 4rem;
}

.prompt-section {
    max-width: 768px;
    margin: 0 auto;
    background: #1A1A1A;
    border-radius: 1rem;
    margin-bottom: 2rem;
}

.promptInput {
    width: 100%;
    height: 160px;
    color: #FFFFFF;
    background-color: #262626;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 400;
    resize: none;
    margin-bottom: 1rem;
    text-align: justify;
}

.promptInput::-webkit-scrollbar {
    width: 0.5rem;
}

.promptInput::-webkit-scrollbar-track {
    border-radius: 500px;
}

.promptInput::-webkit-scrollbar-thumb {
    cursor: auto;
    background: #FFFFFF;
    border-radius: 10px;
}

.promptInput:focus {
    outline: none;
}

.api-input-section {
    margin-bottom: 1rem;
}

.apiKeyInput {
    width: 100%;
    color: #FFFFFF;
    background-color: #262626;
    padding: 0.5rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 400;
    outline: none;
    transition: 0.3s ease;
    text-align: center;
}

.apiKeyInput::placeholder {
    color: #808080;
}

.apiKeyInput:invalid {
    border-color: #EF4444;
}

.api-help-text {
    display: block;
    margin-top: 1rem;
    font-size: 0.75rem;
    color: #808080;
    text-align: center;
}

.api-help-text a {
    color: #3399FF;
    text-decoration: none;
}

.api-help-text a:hover {
    text-decoration: underline;
}

.model-select-section {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.modelSelect {
    width: 320px;
    padding: 0.5rem 1rem;
    color: #D9D9D9;
    background-color: #262626;
    border: none;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    appearance: none;
    outline: none;
    cursor: pointer;
    transition: 0.3s ease;
    text-align: center;
}

.button-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.enhance-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 500px;
    font-size: 0.875rem;
    cursor: pointer;
    background: #0073E6;
    color: #FFFFFF;
    transition: 0.3s;
}

.enhance-btn:hover {
    background: #0066CC;
}

.enhance-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 500px;
    font-size: 0.875rem;
    cursor: pointer;
    background: #FFFFFF;
    color: #262626;
    transition: 0.3s;
}

.btn-primary:hover {
    background-color: #CCCCCC;
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-stop {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 500px;
    font-size: 0.875rem;
    cursor: pointer;
    background: #EF4444;
    color: #FFFFFF;
    transition: 0.3s;
}

.btn-stop:hover {
    background: #DB2424;
}

.suggestions-section {
    padding: 1rem;
    margin-bottom: 2rem;
}

.suggestions-grid {
    max-width: 786px;
    margin: 0 auto;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.suggestion-card {
    display: flex;
    align-items: center;
    color: #FFFFFF;
    background: #262626;
    border-radius: 1rem;
    padding: 0.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: 0.3s;
}

.suggestion-card span {
    font-size: 0.75rem;
}

.suggestion-card:hover {
    background: #FFFFFF;
    color: #262626;
}

.suggestion-card:hover span {
    font-weight: 500;
}

.history-section {
    padding: 1rem;
    margin-bottom: 2rem;
}

.history-container {
    max-width: 1200px;
    margin: 0 auto;
    background: #262626;
    border-radius: 1rem;
    padding: 1.5rem;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.history-header h3 {
    color: #FFFFFF;
    font-size: 1.25rem;
    font-weight: 500;
}

.btn-clear-history {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 500px;
    font-size: 0.875rem;
    cursor: pointer;
    background: #EF4444;
    color: #FFFFFF;
    transition: 0.3s;
}

.btn-clear-history:hover {
    background: #DB2424;
}

.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.history-item {
    background: #1A1A1A;
    border-radius: 0.75rem;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0);
    transition: 0.3s;
}

.history-item:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.history-item-date {
    text-transform: uppercase;
    font-size: 0.75rem;
    color: #808080;
}

.history-item-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-load,
.btn-delete {
    padding: 0.25rem 0.5rem;
    border: none;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: 0.3s;
}

.btn-load {
    background: #0073E6;
    color: #FFFFFF;
}

.btn-load:hover {
    background: #0066CC;
}

.btn-delete {
    background: #EF4444;
    color: #FFFFFF;
}

.btn-delete:hover {
    background: #DB2424;
}

.history-item-prompt {
    font-size: 0.875rem;
    color: #CCCCCC;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.history-item-model {
    font-size: 0.75rem;
    color: #808080;
    font-style: italic;
}

.no-history {
    text-align: center;
    color: #808080;
    font-style: italic;
    padding: 2rem;
}

.loading-section {
    max-width: 786px;
    margin: 0 auto;
    padding: 1rem;
    margin-bottom: 2rem;
    text-align: center;
}

.loading-container {
    background: #262626;
    border-radius: 1rem;
    padding: 1rem;
    max-width: 786px;
    margin: 0 auto;
}

.loading-spinner {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 2px solid #1A1A1A;
    border-top: 2px solid #FFFFFF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-container h3 {
    color: #FFFFFF;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.loading-text {
    color: #CCCCCC;
    margin-bottom: 1rem;
    font-size: 1rem;
    font-weight: 300;
}

.coding-section {
    padding: 1rem;
}

.editor-preview-container {
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    overflow: hidden;
}

.editor-header {
    background: #1E2227;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-tabs {
    display: flex;
    gap: 0.125rem;
}

.tab-btn {
    padding: 0.75rem 1rem;
    border: none;
    color: #FFFFFF;
    background: #1E2227;
    cursor: pointer;
    font-size: 0.75rem;
    transition: 0.3s;
}

.tab-btn.active {
    background: #23272E;
    color: #FFFFFF;
}

.tab-btn:hover:not(.active) {
    background: #323842;
}

.tab-btn:not(.active) {
    color: #B3B3B3;
}

.editor-actions {
    display: flex;
}

.editor-actions .btn-secondary {
    padding: 0.5rem 1rem;
    border: none;
    color: #FFFFFF;
    background: #1E2227;
    cursor: pointer;
    transition: 0.3s;
}

.editor-actions .btn-secondary:hover {
    background: #23272E;
}

.btn-secondary .download {
    width: 20px;
    height: auto;
}

.btn-secondary .refresh {
    width: 20px;
    height: auto;
}

.code-editor {
    width: 100%;
    height: 100%;
    min-height: 500px;
    padding: 1rem;
    border: none;
    font-size: 14px;
    line-height: 1.5;
    resize: none;
    outline: none;
    color: #CCCCCC;
    background: #23272E;
    font-weight: 300;
}

.code-editor::-webkit-scrollbar {
    width: 0.5rem;
}

.code-editor::-webkit-scrollbar-thumb {
    cursor: auto;
    background: #FFFFFF;
}

.preview-header {
    background: #1E2227;
    display: flex;
    justify-content: center;
    align-items: center;
}

.device-controls {
    display: flex;
}

.device-btn {
    padding: 0.5rem 1rem;
    border: none;
    background: #1E2227;
    cursor: pointer;
    transition: 0.3s;
}

.device-btn.active {
    background: #23272E;
}

.device-btn:hover:not(.active) {
    background: #323842;
}

.device-link-btn {
    padding: 0.5rem 1rem;
    border: none;
    background: #1E2227;
    cursor: pointer;
    transition: 0.3s;
}

.device-link-btn.active {
    background: #23272E;
}

.device-link-btn:hover:not(.active) {
    background: #323842;
}

.device-mobile {
    width: 20px;
    height: auto;
}

.device-tablet {
    width: 20px;
    height: auto;
}

.device-desktop {
    width: 20px;
    height: auto;
}

.external-link {
    width: 20px;
    height: auto;
}

.maximize {
    width: 20px;
    height: auto;
}

.preview-container {
    flex: 1;
    padding: 1rem;
    background: #23272E;
    display: flex;
    justify-content: center;
    align-items: center;
}

.preview-frame {
    border: none;
    background: #FFFFFF;
    transition: 0.3s;
}

.preview-frame.resizable {
    resize: horizontal;
    overflow: auto;
    min-width: 375px;
    max-width: 100vw;
    outline: 2px dashed #008CFF;
}

.preview-frame.mobile {
    width: 375px;
    height: 667px;
    max-height: 667px;
}

.preview-frame.tablet {
    width: 768px;
    height: 1365px;
    max-height: 667px;
}

.preview-frame.desktop {
    width: 100%;
    height: 1365px;
    max-height: 667px;
}

.status-div {
    padding: 0.5rem;
}

.status-message {
    max-width: 500px;
    text-align: center;
    margin: 0 auto;
    margin-top: 2rem;
    padding: 0.75rem;
    border-radius: 0.875rem;
    display: none;
    margin-bottom: 2rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-message.success {
    background: #80FFB7;
    color: #136C32;
}

.status-message.info {
    background: #FFDD80;
    color: #806000;
}

.status-message.error {
    background: #FF8080;
    color: #651A1A;
}

.loader {
    animation: pulse 1.5s ease-in-out infinite;
}

.loading-text {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }

}

@keyframes pulse {

    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }

}

@media (max-width: 768px) {

    header h1 {
        font-size: 2rem;
    }

    .prompt-section {
        padding: 1rem;
    }

}

@media (max-width: 600px) {

    .history-container {
        padding: 1rem;
    }

    .editor-header {
        flex-direction: column;
        gap: 1rem;
        justify-content: center;
    }

    .file-tabs {
        justify-content: center;
        flex-wrap: wrap;
    }

    .coding-section {
        padding: 0.5rem;
    }

    .preview-header {
        flex-direction: column;
        gap: 1rem;
        justify-content: center;
    }

}

@media (max-width: 380px) {

    .button-group {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

}

@media (max-width: 350px) {

    .history-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }

}