/* ===========================================
   HTML Minifier Tool - Stylesheet
   =========================================== */

/* ===========================================
   1. Page Header
   =========================================== */
.page-header {
    background-color: #434060;
    color: #ffffff;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.page-header h1 {
    font-size: 2rem;
    margin-bottom: 5px;
    font-weight: bold;
}

.page-header p {
    font-size: 1rem;
    opacity: 0.9;
}

/* ===========================================
   2. Main Container - 3 Column Layout
   =========================================== */
.main-container {
    display: flex;
    height: 70vh;
    position: relative;
}

/* ===========================================
   3. Left Panel - Input Editor
   =========================================== */
.input-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    border-right: 3px solid #434060;
}

/* ===========================================
   4. Middle Panel - Control Buttons
   =========================================== */
.control-panel {
    width: 240px;
    background: #434060;
    display: flex;
    flex-direction: column;
    padding: 20px 15px;
    gap: 12px;
    overflow-y: auto;
    border-right: 3px solid #434060;
}

/* ===========================================
   5. Right Panel - Output Editor
   =========================================== */
.output-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
}

/* ===========================================
   6. Editor Header with Toolbar
   =========================================== */
.editor-header {
    background-color: #434060;
    color: white;
    padding: 6px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

.editor-title {
    font-size: 12px;
    font-weight: 600;
}

.editor-toolbar {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.toolbar-btn {
    background-color: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px 8px;
    font-size: 11px;
    transition: all 0.2s;
    border-radius: 3px;
}

.toolbar-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.toolbar-btn i {
    margin-right: 3px;
}

/* ===========================================
   7. Control Panel Styling
   =========================================== */
.control-panel h4 {
    color: white;
    text-align: center;
    margin-bottom: 10px;
    font-size: 18px;
}

.control-btn {
    background-color: white;
    color: #434060;
    border: 2px solid white;
    padding: 12px;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    font-size: 13px;
}

.control-btn:hover {
    background-color: #e9e9e0;
    color: #434060;
    transform: translateY(-2px);
}

/* ===========================================
   8. Editor Container
   =========================================== */
.editor-container {
    flex: 1;
    position: relative;
    overflow: hidden;
}

#editor,
#output {
    width: 100%;
    height: 100%;
    font-size: 13px;
    line-height: 1.5;
}

/* ===========================================
   9. Custom Ace Editor Styling
   =========================================== */
.ace_editor {
    background-color: #ffffff !important;
    color: #1e293b !important;
}

.ace_gutter {
    background-color: #f5f5f0 !important;
    color: #434060 !important;
    border-right: 2px solid #e9e9e0;
}

.ace_gutter-active-line {
    background-color: #434060 !important;
}

.ace_cursor {
    color: #434060 !important;
}

.ace_marker-layer .ace_active-line {
    background-color: rgba(67, 64, 96, 0.1) !important;
}

.ace_print-margin {
    display: none !important;
}

/* Syntax Highlighting */
.ace_tag {
    color: #dc2626 !important;
}

.ace_entity.ace_name.ace_tag {
    color: #dc2626 !important;
}

.ace_string {
    color: #7c3aed !important;
}

.ace_entity.ace_other.ace_attribute-name {
    color: #7c3aed !important;
}

.ace_constant.ace_numeric {
    color: #0891b2 !important;
}

.ace_text-layer {
    color: #1e293b !important;
}

.ace_keyword {
    color: #dc2626 !important;
}

.ace_comment {
    color: #059669 !important;
    font-style: italic;
}

/* ===========================================
   10. Scrollbar
   =========================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #e9e9e0;
}

::-webkit-scrollbar-thumb {
    background: #434060;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5a4f7a;
}

/* ===========================================
   11. Alert
   =========================================== */
.custom-alert {
    position: fixed;
    top: 20px;
    right: 20px;
    min-width: 300px;
    padding: 15px 20px;
    border-radius: 5px;
    color: white;
    font-weight: 500;
    z-index: 9999;
    display: none;
    animation: slideIn 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.alert-success {
    background-color: #434060;
}

.alert-error {
    background-color: #ef4444;
}

.alert-warning {
    background-color: #f59e0b;
}

.alert-info {
    background-color: #434060;
}

/* ===========================================
   12. File Input
   =========================================== */
.file-input-wrapper {
    position: relative;
    overflow: hidden;
    display: none;
}

.file-input-wrapper input[type=file] {
    position: absolute;
    left: -9999px;
}

/* ===========================================
   13. Fullscreen
   =========================================== */
.fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9998 !important;
    border: none !important;
}

/* ===========================================
   14. Modal Styling
   =========================================== */
.modal-content-custom {
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    border-radius: 15px;
}

.modal-header-custom {
    background: linear-gradient(135deg, #434060 0%, #5a5578 100%);
    color: white;
    border-radius: 15px 15px 0 0;
    padding: 25px 30px;
    border: none;
}

.modal-title-custom {
    font-weight: 600;
    font-size: 22px;
    color: white;
}

.modal-subtitle-custom {
    font-size: 13px;
    opacity: 0.9;
    color: white;
    margin-bottom: 0;
}

.modal-body-custom {
    padding: 30px;
}

.modal-footer-custom {
    border-top: 1px solid #e0e0e0;
    padding: 20px 30px;
    background: #f8f9fa;
    border-radius: 0 0 15px 15px;
}

#loadDataTabs {
    background: #f5f5f0;
    padding: 8px;
    border-radius: 10px;
    display: inline-flex;
    width: 100%;
}

#loadDataTabs .nav-item {
    flex: 1;
}

#loadDataTabs .nav-link {
    background: transparent;
    color: #666;
    width: 100%;
    border-radius: 8px;
    padding: 12px 20px;
    font-weight: 600;
    transition: all 0.3s;
    border: none;
}

#loadDataTabs .nav-link:hover {
    color: #434060;
}

#loadDataTabs .nav-link.active {
    background: linear-gradient(135deg, #434060 0%, #5a5578 100%);
    color: white;
    box-shadow: 0 4px 10px rgba(67, 64, 96, 0.2);
}

.modal-input-custom {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 15px;
    font-size: 15px;
    transition: all 0.3s;
}

.modal-input-custom:focus {
    border-color: #434060;
    box-shadow: 0 0 0 3px rgba(67, 64, 96, 0.1);
    outline: none;
}

.modal-btn-primary {
    background: linear-gradient(135deg, #434060 0%, #5a5578 100%);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 15px;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s;
}

.modal-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(67, 64, 96, 0.3);
}

.modal-btn-cancel {
    background: white;
    color: #666;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px 25px;
    font-weight: 600;
    transition: all 0.3s;
}

.modal-btn-cancel:hover {
    border-color: #434060;
    color: #434060;
}

.drop-zone-custom {
    border: 3px dashed #434060;
    border-radius: 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    transition: all 0.3s;
    cursor: pointer;
    text-align: center;
    padding: 3rem;
}

.drop-zone-custom:hover {
    border-color: #5a4f7a;
    background: #e9e9e0;
    transform: scale(1.02);
}

.drop-zone-icon {
    font-size: 48px;
    color: #434060;
    margin-bottom: 1rem;
}

.drop-zone-title {
    color: #434060;
    font-weight: 600;
    margin-bottom: 8px;
}

.drop-zone-subtitle {
    font-size: 13px;
    color: #666;
    margin-bottom: 0;
}

.modal-content {
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ===========================================
   15. Accordion Styling
   =========================================== */
.accordion-button {
    background-color: #f5f5f0;
    color: #434060;
    font-weight: 600;
}

.accordion-button:not(.collapsed) {
    background-color: #434060;
    color: #ffffff;
}

.accordion-button:focus {
    box-shadow: 0 0 0 0.25rem rgba(67, 64, 96, 0.25);
}

.accordion-body {
    background-color: #ffffff;
    color: #333;
    line-height: 1.8;
}

/* ===========================================
   16. RESPONSIVE DESIGN
   =========================================== */

/* Tablet (Portrait and Landscape) */
@media (max-width: 1024px) {
    .main-container {
        height: auto;
        flex-direction: column;
    }

    .input-panel,
    .output-panel {
        border-right: none;
        border-bottom: 3px solid #434060;
        min-height: 400px;
    }

    .control-panel {
        width: 100%;
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
        padding: 15px;
        border-right: none;
        border-bottom: 3px solid #434060;
    }

    .control-btn {
        flex: 1;
        min-width: 150px;
        max-width: 200px;
    }

    .editor-header {
        padding: 10px 15px;
    }

    .editor-toolbar {
        flex-wrap: wrap;
    }

    .custom-alert {
        right: 10px;
        left: 10px;
        min-width: auto;
    }
}

/* Mobile (Portrait) */
@media (max-width: 768px) {
    .page-header h1 {
        font-size: 1.5rem;
    }

    .page-header p {
        font-size: 0.9rem;
    }

    .main-container {
        height: auto;
    }

    .input-panel,
    .output-panel {
        min-height: 350px;
    }

    .control-panel {
        flex-direction: column;
        padding: 15px;
        gap: 10px;
    }

    .control-btn {
        width: 100%;
        max-width: 100%;
        padding: 15px;
        font-size: 14px;
    }

    .editor-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px;
    }

    .editor-title {
        font-size: 14px;
        margin-bottom: 8px;
    }

    .editor-toolbar {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 5px;
    }

    .toolbar-btn {
        font-size: 10px;
        padding: 6px 10px;
    }

    #editor,
    #output {
        font-size: 12px;
    }

    .custom-alert {
        top: 10px;
        right: 10px;
        left: 10px;
        min-width: auto;
        padding: 12px 15px;
        font-size: 14px;
    }

    .modal-dialog {
        margin: 10px;
    }

    .modal-header-custom {
        padding: 20px;
    }

    .modal-title-custom {
        font-size: 18px;
    }

    .modal-body-custom {
        padding: 20px;
    }

    #loadDataTabs {
        flex-direction: column;
        padding: 5px;
    }

    #loadDataTabs .nav-link {
        padding: 10px 15px;
        margin-bottom: 5px;
    }

    .drop-zone-custom {
        padding: 2rem 1rem;
    }

    .drop-zone-icon {
        font-size: 36px;
    }

    .modal-footer-custom {
        padding: 15px 20px;
    }

    .table-list {
        margin-bottom: 30px;
    }

    .content-text {
        padding-bottom: 30px !important;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .page-header {
        padding: 15px 10px;
    }

    .page-header h1 {
        font-size: 1.3rem;
    }

    .input-panel,
    .output-panel {
        min-height: 300px;
    }

    .control-panel {
        padding: 10px;
        gap: 8px;
    }

    .control-btn {
        padding: 12px;
        font-size: 13px;
    }

    .editor-title {
        font-size: 12px;
    }

    .toolbar-btn {
        font-size: 9px;
        padding: 5px 8px;
    }

    .toolbar-btn i {
        margin-right: 2px;
    }

    #editor,
    #output {
        font-size: 11px;
    }

    .modal-title-custom {
        font-size: 16px;
    }

    .modal-subtitle-custom {
        font-size: 12px;
    }

    .drop-zone-custom {
        padding: 1.5rem 0.5rem;
    }

    .drop-zone-icon {
        font-size: 30px;
    }

    .drop-zone-title {
        font-size: 14px;
    }

    .drop-zone-subtitle {
        font-size: 12px;
    }
}

/* Landscape orientation for mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .main-container {
        flex-direction: row;
        height: auto;
        min-height: 500px;
    }

    .input-panel,
    .output-panel {
        flex: 1;
        border-right: 2px solid #434060;
        border-bottom: none;
    }

    .output-panel {
        border-right: none;
    }

    .control-panel {
        width: 180px;
        flex-direction: column;
        border-right: 2px solid #434060;
        border-bottom: none;
    }

    .control-btn {
        width: 100%;
        max-width: 100%;
    }
}

/* Print styles */
@media print {
    .control-panel,
    .editor-toolbar,
    .custom-alert,
    .modal {
        display: none !important;
    }

    .main-container {
        height: auto;
        flex-direction: row;
    }

    .input-panel,
    .output-panel {
        border: 1px solid #ddd;
    }

    .page-header {
        background-color: white;
        color: #434060;
        border-bottom: 2px solid #434060;
    }
}
