/* Commands Page Specific Styles */

/* Category dropdown - blue text color */
#commandCategory.select-input {
    color: #4fc3f7 !important;
}

#commandCategory.select-input option {
    color: #4fc3f7;
    background: rgba(15, 30, 45, 0.95);
}

/* Copy of button styles from styles.css */
.commands-page .corner-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 10px;
    max-width: 300px;
}

.commands-page .corner-btn {
    background: rgba(79, 195, 247, 0.2);
    border: 2px solid #4fc3f7;
    border-radius: 6px;
    padding: 12px 20px;
    color: #4fc3f7;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    font-weight: 500;
    min-width: 150px;
    position: relative;
    overflow: hidden;
}

.commands-page .corner-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(79, 195, 247, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}

.commands-page .corner-btn:hover::before {
    width: 400px;
    height: 400px;
    max-width: 400px;
    max-height: 400px;
}

.commands-page .corner-btn:hover {
    background: rgba(79, 195, 247, 0.3);
    box-shadow: 
        0 0 25px rgba(79, 195, 247, 0.7),
        0 0 50px rgba(79, 195, 247, 0.5),
        inset 0 0 25px rgba(79, 195, 247, 0.2);
    transform: translateY(-3px);
    border-color: #81c784;
    max-width: 400px;
    max-height: 400px;
}

.commands-page .corner-btn:active {
    transform: scale(0.96) translateY(0);
}

.commands-page .corner-btn > * {
    position: relative;
    z-index: 1;
}

/* Section box size - controls the size of ALL section containers */
/* NOTE: This is CSS height, NOT related to any input fields */
.commands-page .section {
    background: rgba(26, 47, 74, 0.8);
    border: 2px solid transparent;
    background-clip: padding-box;
    border-radius: 10px;
    padding: 15px; /* Space inside the section */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    position: relative;
    transition: all 0.3s ease;
    z-index: 1;
    width: 100%;
}

/* Buttons Section (left column) - Edit these to change the buttons section size */
.commands-page .left-column .section {
    /* Edit these to change ONLY the buttons section size: */
    max-width: 350px; /* Maximum width of the buttons section */
    min-width: 300px;
    /* min-height: 200px; */ /* Uncomment to set minimum height */
    /* max-height: 500px; */ /* Uncomment to set maximum height */
}

/* Commands Section (right column) - Edit these to change the commands section size */
.commands-page .right-column .section {
    /* Edit these to change ONLY the commands section size: */
    max-width: 1450px; /* Maximum width of the commands section */
    min-width: 1450px;
    /* min-height: 200px; */ /* Uncomment to set minimum height */
    /* max-height: 500px; */ /* Uncomment to set maximum height */
}

.commands-content {
    padding: 20px;
    line-height: 1.6;
}

.commands-content p {
    margin-bottom: 15px;
}

/* Command Section Styles */
.command-section {
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(15, 30, 45, 0.5);
    border: 1px solid rgba(79, 195, 247, 0.2);
    border-radius: 8px;
}

.command-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.command-name {
    color: #4fc3f7;
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
}

.command-input {
    background: rgba(26, 47, 74, 0.8);
    border: 2px solid rgba(79, 195, 247, 0.3);
    border-radius: 6px;
    padding: 8px 12px;
    color: #e0e0e0;
    font-size: 14px;
    min-width: 120px;
    transition: all 0.3s ease;
}

.command-input:focus {
    outline: none;
    border-color: #4fc3f7;
    box-shadow: 0 0 8px rgba(79, 195, 247, 0.4);
}

.command-select {
    background: rgba(26, 47, 74, 0.8);
    border: 2px solid rgba(79, 195, 247, 0.3);
    border-radius: 6px;
    padding: 8px 12px;
    color: #e0e0e0;
    font-size: 14px;
    min-width: 200px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.command-select:focus {
    outline: none;
    border-color: #4fc3f7;
    box-shadow: 0 0 8px rgba(79, 195, 247, 0.4);
}

.command-select option {
    background: rgba(15, 30, 45, 0.95);
    color: #e0e0e0;
}

.command-output {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px; /* Change these values to adjust internal spacing (top/bottom, left/right) */
    background: rgba(10, 25, 41, 0.8);
    border: 1px solid rgba(79, 195, 247, 0.2);
    border-radius: 6px;
    word-break: break-all;
    max-width: 1px; /* Maximum width - change to a specific value like 500px or 80% */
    width: 1px;
    min-width: 1300px; /* Actual width - change to a specific value like 400px or 90% */
}

.command-output code {
    color: #81c784;
    font-family: 'Courier New', monospace;
    font-size: 12px; /* Change this to adjust text size (e.g., 11px for smaller, 14px for larger) */
    flex: 1;
    max-width: 100%;
}

.copy-btn {
    background: rgba(79, 195, 247, 0.2);
    border: 1px solid #4fc3f7;
    border-radius: 4px;
    padding: 5px 10px;
    color: #4fc3f7;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.copy-btn:hover {
    background: rgba(79, 195, 247, 0.3);
    box-shadow: 0 0 8px rgba(79, 195, 247, 0.4);
}

/* Items Command Styles */
.item-search-results {
    position: relative;
    margin-top: 5px;
    max-height: 300px;
    overflow-y: auto;
    background: rgba(15, 30, 45, 0.95);
    border: 1px solid rgba(79, 195, 247, 0.2);
    border-radius: 6px;
    z-index: 100;
}

.search-result-item {
    padding: 10px 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(79, 195, 247, 0.1);
}

.search-result-item:hover {
    background: rgba(79, 195, 247, 0.2);
}

.search-result-item:last-child {
    border-bottom: none;
}

.result-item-name {
    color: #4fc3f7;
    font-weight: 500;
    margin-bottom: 4px;
}

.result-item-path {
    color: #81c784;
    font-size: 11px;
    font-family: 'Courier New', monospace;
    word-break: break-all;
}

.selected-item-info {
    margin-top: 15px;
    padding: 15px;
    background: rgba(15, 30, 45, 0.5);
    border: 1px solid rgba(79, 195, 247, 0.2);
    border-radius: 6px;
}

.item-info-row {
    margin-bottom: 10px;
    color: #e0e0e0;
}

.item-info-row:last-child {
    margin-bottom: 0;
}

.item-info-row strong {
    color: #4fc3f7;
    margin-right: 8px;
}

.item-path {
    color: #81c784;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    word-break: break-all;
    display: block;
    margin-top: 5px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    color: #4fc3f7;
    margin-bottom: 5px;
    font-size: 14px;
}

.checkbox-input {
    margin-right: 8px;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.command-section h3 {
    color: #4fc3f7;
    font-size: 16px;
    margin-bottom: 15px;
}

/* Responsive Design for Commands Page */
@media (max-width: 768px) {
    .commands-page .container {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        padding: 0 10px;
    }
    
    /* Reorder sections on mobile - Category, Pages, then Commands */
    .commands-page .main-grid {
        display: flex !important;
        flex-direction: column !important;
    }
    
    .commands-page .left-column {
        order: 1 !important; /* Category and Pages first */
    }
    
    .commands-page .right-column {
        order: 2 !important; /* Commands section after */
    }
    
    /* Make sure search results can overflow and show, and section grows to fit content */
    .commands-page .right-column .section {
        overflow: visible !important;
        min-height: auto !important;
        height: auto !important;
        max-height: none !important;
        flex: none !important;
    }
    
    .commands-page .commands-content {
        overflow: visible !important;
        min-height: auto !important;
        height: auto !important;
        max-height: none !important;
    }
    
    .commands-page .command-section {
        overflow: visible !important;
        min-height: auto !important;
        height: auto !important;
        max-height: none !important;
        margin-bottom: 20px !important;
    }
    
    /* Ensure content doesn't get cut off */
    .commands-page .right-column {
        padding-bottom: 100px !important;
    }
    
    .selected-item-info {
        margin-bottom: 15px !important;
    }
    
    .command-output {
        margin-bottom: 15px !important;
    }
    
    /* Make sure the section box wraps all content */
    .commands-page .section {
        display: block !important;
        height: auto !important;
        max-height: none !important;
    }
    
    .item-search-results {
        position: absolute !important;
        width: calc(100% - 30px) !important;
        left: 15px;
        z-index: 1000 !important;
        background: rgba(15, 30, 45, 0.98) !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5) !important;
    }
    
    /* Make Pages section collapsible on mobile */
    .commands-page .left-column .section:last-child {
        max-height: 60px;
        overflow: hidden;
        transition: max-height 0.3s ease;
        cursor: pointer;
        position: relative;
    }
    
    .commands-page .left-column .section:last-child::after {
        content: 'Tap to expand';
        position: absolute;
        bottom: 5px;
        left: 50%;
        transform: translateX(-50%);
        font-size: 10px;
        color: rgba(79, 195, 247, 0.5);
        pointer-events: none;
    }
    
    .commands-page .left-column .section:last-child.expanded {
        max-height: 500px;
    }
    
    .commands-page .left-column .section:last-child.expanded::after {
        content: none;
    }
    
    .commands-page .left-column .section:last-child h2 {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    .collapse-indicator {
        display: inline-block;
    }
    
    .commands-page .left-column .section,
    .commands-page .right-column .section {
        max-width: 100% !important;
        min-width: 0 !important;
        width: 100% !important;
    }
    
    .commands-page .right-column .section {
        min-width: 0 !important;
    }
    
    .commands-page .corner-buttons {
        grid-template-columns: 1fr !important;
        max-width: 100% !important;
        gap: 12px;
        margin-top: 12px;
    }
    
    .commands-page .corner-btn {
        min-width: 0 !important;
        width: 100%;
        padding: 14px 18px;
        font-size: 15px;
        min-height: 48px;
        touch-action: manipulation;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .command-section {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .command-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .command-name {
        font-size: 12px;
    }
    
    .command-input,
    .command-select {
        width: 100% !important;
        min-width: 0 !important;
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px 14px;
        box-sizing: border-box;
        min-height: 48px;
        border-radius: 10px;
        -webkit-appearance: none;
        appearance: none;
        touch-action: manipulation;
    }
    
    .command-select {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234fc3f7' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 14px center;
        background-size: 12px;
        padding-right: 40px;
    }
    
    .command-output {
        flex-direction: column;
        align-items: stretch;
        padding: 15px;
        max-width: 100% !important;
        width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box;
        gap: 12px;
        max-height: none !important;
        height: auto !important;
        overflow: visible !important;
    }
    
    .command-output code {
        font-size: 0.85em;
        word-break: break-word;
        overflow-wrap: break-word;
        max-width: 100%;
        line-height: 1.5;
        padding: 0;
        white-space: pre-wrap !important;
        display: block !important;
    }
    
    .copy-btn {
        width: 100%;
        padding: 14px 18px;
        font-size: 15px;
        margin-top: 0;
        min-height: 48px;
        touch-action: manipulation;
        justify-content: center;
    }
    
    .commands-content {
        padding: 10px;
    }
    
    .form-group {
        margin-bottom: 12px;
    }
    
    .form-group label {
        font-size: 0.9em;
    }
    
    .item-search-results {
        max-height: 200px;
    }
    
    .search-result-item {
        padding: 8px 12px;
    }
    
    .result-item-name {
        font-size: 0.9em;
    }
    
    .result-item-path {
        font-size: 10px;
    }
    
    .selected-item-info {
        padding: 12px;
    }
    
    .item-info-row {
        font-size: 0.9em;
        margin-bottom: 8px;
    }
    
    .command-group {
        margin-bottom: 15px;
    }
}

@media (max-width: 480px) {
    .commands-page .corner-btn {
        padding: 12px 16px;
        font-size: 14px;
        min-height: 44px;
    }
    
    .command-section {
        padding: 12px;
        margin-bottom: 15px;
    }
    
    .command-name {
        font-size: 0.9em;
    }
    
    .command-input,
    .command-select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px;
        min-height: 44px;
    }
    
    .command-output {
        padding: 12px;
    }
    
    .command-output code {
        font-size: 0.8em;
    }
    
    .copy-btn {
        padding: 12px 16px;
        font-size: 14px;
        min-height: 44px;
    }
    
    .commands-content {
        padding: 8px;
    }
    
    .form-group {
        margin-bottom: 10px;
    }
    
    .form-group label {
        font-size: 0.85em;
    }
    
    .item-search-results {
        max-height: 150px;
    }
    
    .search-result-item {
        padding: 6px 10px;
    }
    
    .result-item-name {
        font-size: 0.85em;
    }
    
    .result-item-path {
        font-size: 9px;
    }
    
    .selected-item-info {
        padding: 10px;
    }
    
    .item-info-row {
        font-size: 0.85em;
        margin-bottom: 6px;
    }
}

