/* Brand and Base Styles */
/* Overall branding, colors, typography, and shared UI components */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    color: #2d3748;
    min-height: 100vh;
    padding: 20px;
    margin: 0;
}

.container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 0;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    min-height: auto;
    overflow: hidden;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 2px solid #e2e8f0;
    position: relative;
    z-index: 1002; /* Ensure header stays above sidebar (1000) and hamburger (1001) */
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.active-tab-indicator {
    font-size: 0.9em;
    color: #667eea;
    font-weight: 500;
    display: none; /* Hidden by default, shown on mobile */
}

@media (max-width: 767px) {
    .active-tab-indicator {
        display: block;
    }
}

@media (min-width: 768px) {
    body {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }
    
    .header {
        padding: 30px 40px;
    }
    
    .active-tab-indicator {
        display: none; /* Hide on desktop */
    }
}

.app-layout {
    display: flex;
    min-height: calc(100vh - 200px);
}

@media (max-width: 767px) {
    .app-layout {
        position: relative;
    }
}

h1 {
    margin: 0;
    color: #4a5568;
    font-weight: 300;
    font-size: 1.5em;
}

@media (min-width: 768px) {
    h1 {
        font-size: 2em;
    }
}

/* Hamburger Menu */
.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.hamburger span {
    width: 100%;
    height: 3px;
    background: #4a5568;
    border-radius: 3px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

@media (min-width: 768px) {
    .hamburger {
        display: none;
    }
}

/* Sidebar Navigation */
.sidebar {
    background: #f7fafc;
    padding: 20px 0;
    transition: transform 0.3s ease;
}

@media (max-width: 767px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100vh;
        z-index: 1000;
        transform: translateX(-100%);
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        overflow-y: auto;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    /* Overlay when menu is open */
    .sidebar.open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 280px;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
    }
}

@media (min-width: 768px) {
    .sidebar {
        width: 200px;
        min-width: 200px;
        border-right: 2px solid #e2e8f0;
    }
}

/* Tab Navigation */
.tabs {
    display: flex;
    flex-direction: column;
    gap: 0;
}

@media (max-width: 767px) {
    .tabs {
        padding: 20px 0;
    }
}

.tab {
    padding: 15px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: #718096;
    border-left: 3px solid transparent;
    border-bottom: none;
    transition: all 0.3s ease;
    text-align: left;
    width: 100%;
}

@media (min-width: 768px) {
    .tab {
        padding: 15px 25px;
        font-size: 16px;
    }
}

.tab:hover:not(.disabled) {
    color: #4a5568;
}

.tab.disabled {
    cursor: not-allowed;
    opacity: 0.5;
    pointer-events: none;
}

.tab.active {
    color: #667eea;
    border-left-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    font-weight: 600;
}

/* Main Content Area */
.main-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

@media (min-width: 768px) {
    .main-content {
        padding: 40px;
    }
}

.tab-content {
    display: none;
}

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

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    min-width: 80px;
}

@media (min-width: 768px) {
    .btn {
        padding: 12px 30px;
        font-size: 16px;
        min-width: auto;
    }
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.btn-secondary:hover {
    background: #cbd5e0;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn:focus {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

.btn:focus:not(:focus-visible) {
    outline: none;
}

/* Preset Buttons */
.preset-btn {
    padding: 6px 16px;
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s ease;
}

@media (min-width: 768px) {
    .preset-btn {
        padding: 8px 20px;
        font-size: 14px;
    }
}

.preset-btn:hover {
    border-color: #667eea;
    background: #edf2f7;
}

/* Utility Classes */
.hidden {
    display: none;
}

.status-indicator {
    font-size: 0.9em;
    color: #718096;
    text-align: center;
    margin-top: 10px;
}

/* Status Footer */
.status-footer {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    padding: 12px 15px;
    background: #f7fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

@media (min-width: 768px) {
    .status-footer {
        margin-top: 30px;
        padding: 15px 20px;
    }
}

.status-icon {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 20px;
    transition: all 0.3s ease;
    cursor: help;
    min-width: fit-content;
}

.status-icon svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.status-label {
    font-size: 0.85em;
    font-weight: 500;
    white-space: nowrap;
}

.status-icon.status-clickable {
    cursor: pointer;
}

.status-icon.status-active {
    background: #c6f6d5;
    color: #22543d;
}

.status-icon.status-active .status-label {
    color: #22543d;
}

.status-icon.status-active:hover {
    background: #9ae6b4;
}

.status-icon.status-inactive {
    background: #fed7d7;
    color: #742a2a;
    opacity: 0.6;
}

.status-icon.status-inactive .status-label {
    color: #742a2a;
}

.status-icon.status-inactive:hover {
    background: #fc8181;
    opacity: 1;
}

.status-icon.status-unsupported {
    background: #e2e8f0;
    color: #718096;
    opacity: 0.5;
}

.status-icon.status-unsupported .status-label {
    color: #718096;
}

.status-icon.status-unsupported:hover {
    opacity: 0.7;
}

/* Tooltip */
.status-icon[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 8px;
    padding: 8px 12px;
    background: #2d3748;
    color: white;
    font-size: 12px;
    white-space: nowrap;
    border-radius: 6px;
    pointer-events: none;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.status-icon[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 2px;
    border: 5px solid transparent;
    border-top-color: #2d3748;
    pointer-events: none;
    z-index: 1000;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.modal {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal h3 {
    color: #2d3748;
    margin-bottom: 15px;
    font-size: 1.5em;
    font-weight: 500;
}

.modal-message {
    color: #4a5568;
    line-height: 1.6;
    margin-bottom: 25px;
}

.modal-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-modal {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.btn-modal-primary {
    background: #48bb78;
    color: white;
}

.btn-modal-primary:hover {
    background: #38a169;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(72, 187, 120, 0.4);
}

.btn-modal-secondary {
    background: #ecc94b;
    color: #744210;
}

.btn-modal-secondary:hover {
    background: #d69e2e;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(236, 201, 75, 0.4);
}

.btn-modal-cancel {
    background: #e2e8f0;
    color: #4a5568;
}

.btn-modal-cancel:hover {
    background: #cbd5e0;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(45, 55, 72, 0.2);
}