@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Poppins:wght@600;700&display=swap');

body {
    font-family: 'Inter', sans-serif;
    color: #003366;
    background-color: #f9f9fb;
    margin: 0;
    transition: background-color 0.3s ease;
}

.no-scroll {
    overflow: hidden;
}

h1, h2, h3 {
    font-family: 'Poppins', sans-serif;
}

.ai-app-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
}

.ai-app-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 24px;
    margin-bottom: 24px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ai-app-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.ai-app-button {
    background: #0066CC;
    color: #fff;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.3s ease, transform 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.ai-app-button:hover {
    background: #FF7F00;
    transform: scale(1.05);
}

.ai-app-form-field {
    margin-bottom: 20px;
}

.ai-app-form-field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #003366;
    margin-bottom: 8px;
}

.ai-app-form-field input,
.ai-app-form-field textarea,
.ai-app-form-field select {
    width: 100%;
    padding: 12px;
    border: 1px solid #008080;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.ai-app-form-field input:focus,
.ai-app-form-field textarea:focus,
.ai-app-form-field select:focus {
    border-color: #0066CC;
    box-shadow: 0 0 8px rgba(0, 102, 204, 0.2);
    outline: none;
}

.ai-app-form-field textarea {
    resize: vertical;
    min-height: 100px;
}

/* Toggle Switch */
.toggle-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.toggle-switch {
    position: relative;
    width: 60px;
    height: 34px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #0066CC;
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.toggle-label {
    font-size: 14px;
    font-weight: 600;
    color: #003366;
}

.custom-url-field {
    display: none;
    margin-top: 12px;
}

.custom-url-field.active {
    display: block;
}

/* Monaco Editor */
#monaco-editor {
    width: 100%;
    height: 500px;
    border: 1px solid #008080;
    border-radius: 8px;
    margin-bottom: 20px;
}

.editor-container.fullscreen {
    display: flex;
    flex-direction: column;
}

.editor-container.fullscreen #monaco-editor {
    flex: 1;
    height: 100%;
    width: 100%;
}
.editor-container.fullscreen .close-fullscreen {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
}

body.dark-mode .editor-container.fullscreen {
    background: #2e3b3e;
}

.editor-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #0066CC;
    color: #fff;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    transition: background 0.3s ease;
}

.theme-toggle:hover {
    background: #FF7F00;
}

.theme-toggle .icon {
    font-size: 18px;
}

body.dark-mode {
    background: #1c2526;
    color: #e0e7e9;
}

body.dark-mode .ai-app-card {
    background: #2e3b3e;
    border-color: #FF7F00;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

body.dark-mode .ai-app-form-field label,
body.dark-mode .toggle-label {
    color: #e0e7e9;
}

body.dark-mode .ai-app-form-field input,
body.dark-mode .ai-app-form-field textarea,
body.dark-mode .ai-app-form-field select {
    background: #3a4a4d;
    border-color: #FF7F00;
    color: #e0e7e9;
}

body.dark-mode .toggle-slider {
    background-color: #555;
}

body.dark-mode input:checked + .toggle-slider {
    background-color: #FF7F00;
}

/* File Manager */
.file-manager-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.file-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 16px;
    text-align: center;
    transition: transform 0.3s ease;
}

body.dark-mode .file-card {
    background: #2e3b3e;
}

.file-card:hover {
    transform: translateY(-4px);
}

.file-card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 12px;
    cursor: pointer;
}

.file-card .button-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Image Preview Popup */
.image-preview-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.image-preview-popup.active {
    display: flex;
}

.image-preview-popup img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
}

.image-preview-popup .close-button {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #FF7F00;
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

.image-preview-popup .close-button:hover {
    background: #0066CC;
}

/* Compression Modal */
.compress-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    padding: 24px;
    max-width: 600px;
    width: 90%;
    z-index: 1000;
}

.compress-modal.active {
    display: block;
}

.compress-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.compress-modal .modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.compress-modal .modal-header .close-button {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
}

.compress-modal .modal-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.compress-modal .preview-img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    cursor: pointer;
}

.compress-modal .report {
    background: #f9f9fb;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
}

.compress-modal .button-group {
    display: flex;
    gap: 12px;
}

body.dark-mode .compress-modal {
    background: #2e3b3e;
    color: #e0e7e9;
}

body.dark-mode .compress-modal .report {
    background: #3a4a4d;
}

/* Dashboard Grid */
.app-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.app-grid.grid-8 {
    grid-template-columns: repeat(8, 1fr);
}

.app-grid .ai-app-card {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.app-grid .ai-app-card img {
    max-width: 100px;
    margin-bottom: 12px;
}

.app-grid .ai-app-card .button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.grid-selector,
.limits-display {
    margin-bottom: 20px;
}

.grid-selector select,
.limits-display select {
    padding: 8px;
    border-radius: 8px;
    border: 1px solid #008080;
    font-size: 14px;
}

.limits-display p {
    font-size: 14px;
    font-weight: 500;
}

.ai-app-error-message {
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 5px;
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    font-size: 14px;
}

.ai-app-error-message.malicious {
    background-color: #dc3545;
    color: #fff;
    border: none;
}

.card-view .ai-app-card {
    width: 25%;
    padding: 15px;
    box-sizing: border-box;
    float: left;
}
.app-table {
    width: 100%;
    border-collapse: collapse;
}
.app-table th, .app-table td {
    padding: 12px;
    border: 1px solid #ddd;
    text-align: left;
}
.ai-app-button.active {
    background-color: #007bff;
    color: white;
}

/* Ikon tombol */
.icon-button {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2em;
    color: #007bff;
    padding: 5px;
    transition: color 0.3s ease;
}

.icon-button:hover {
    color: #0056b3;
}

/* Tooltip untuk ikon */
.icon-button[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
    white-space: nowrap;
    font-size: 12px;
    z-index: 10;
}

.ai-app-form-field input:not([type="checkbox"]),
.ai-app-form-field textarea,
.ai-app-form-field select {
    width: 100% !important;
    padding: 12px !important;
    border: 1px solid #008080 !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    transition: border-color 0.3s ease, box-shadow 0.3s ease !important;
}

/* Styling khusus untuk checkbox */
.ai-app-form-field input[type="checkbox"] {
    width: auto !important;
    margin-right: 8px !important;
    transform: scale(1.2) !important; /* Untuk membesarkan tampilan checkbox */
}

/* Tab Menu */
.tab-menu {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-button {
    padding: 10px 20px;
    background: #0066CC;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.tab-button.active {
    background: #FF7F00;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

@media (max-width: 1200px) {
    .app-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .app-grid.grid-8 {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .ai-app-container {
        padding: 12px;
    }

    .ai-app-card {
        padding: 16px;
    }

    .file-manager-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .app-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .app-grid.grid-8 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    .app-grid {
        grid-template-columns: 1fr;
    }
    .app-grid.grid-8 {
        grid-template-columns: 1fr;
    }
}
