/* FlexGrabber Web App Styles */

/* Import Inter Font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #18181B;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
    background-size: 35px 35px;
    background-attachment: fixed;
    color: #ffffff;
    min-height: 100vh;
    line-height: 1.6;
}

/* Container and Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

@media (max-width: 768px) {
    .container {
        padding: 0.5rem;
        max-width: 100%;
    }
}

.main-content {
    margin-left: 280px;
    padding: 2rem;
    min-height: 100vh;
}

@media (max-width: 768px) {
    .main-content {
        margin-left: 0;
        padding: 0.25rem;
    }
}

/* Navigation Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: rgba(24, 24, 27, 0.95);
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem;
    z-index: 1000;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #21b4c0;
    margin-bottom: 3rem;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo img {
    max-width: 100%;
    height: auto;
    max-height: 60px;
}

.nav-menu {
    list-style: none;
}

.nav-item {
    margin-bottom: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(33, 180, 192, 0.1);
    color: #21b4c0;
}

.nav-icon {
    margin-right: 0.75rem;
    font-size: 1.2rem;
}

/* Button Styles (Based on your original design) */
.btn {
    color: #ffffff;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    text-shadow: 0 1px 1px rgba(0,0,0,0.1);
    padding: 0.8em 1.7em;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background-color: #21b4c0;
    box-shadow:
        inset 0px 1px 1px rgba(255, 255, 255, 0.3),
        inset 0px -1px 1px rgba(0, 0, 0, 0.1),
        0 0 4px 6px rgba(33, 180, 192, 0.25);
}

.btn-primary:hover {
    background-color: #25c9e3;
    box-shadow:
        inset 0px 1px 1px rgba(255, 255, 255, 0.4),
        inset 0px -1px 1px rgba(0, 0, 0, 0.1),
        0 0 6px 7px rgba(33, 180, 192, 0.35);
}

.btn-blue {
    background-color: #0578FF;
    box-shadow:
        inset 0px 1px 1px rgba(255, 255, 255, 0.3),
        inset 0px -1px 1px rgba(0, 0, 0, 0.1),
        0 0 4px 6px rgba(5, 120, 255, 0.25);
}

.btn-blue:hover {
    background-color: #1a85ff;
    box-shadow:
        inset 0px 1px 1px rgba(255, 255, 255, 0.4),
        inset 0px -1px 1px rgba(0, 0, 0, 0.1),
        0 0 6px 7px rgba(5, 120, 255, 0.35);
}

.btn-orange {
    background-color: #ff7817;
    box-shadow:
        inset 0px 1px 1px rgba(255, 255, 255, 0.3),
        inset 0px -1px 1px rgba(0, 0, 0, 0.1),
        0 0 4px 6px rgba(255, 120, 23, 0.25);
}

.btn-orange:hover {
    background-color: #ff8530;
    box-shadow:
        inset 0px 1px 1px rgba(255, 255, 255, 0.4),
        inset 0px -1px 1px rgba(0, 0, 0, 0.1),
        0 0 6px 7px rgba(255, 120, 23, 0.35);
}

.btn-danger {
    background-color: #ef4444;
    box-shadow:
        inset 0px 1px 1px rgba(255, 255, 255, 0.3),
        inset 0px -1px 1px rgba(0, 0, 0, 0.1),
        0 0 4px 6px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
    background-color: #f87171;
    box-shadow:
        inset 0px 1px 1px rgba(255, 255, 255, 0.4),
        inset 0px -1px 1px rgba(0, 0, 0, 0.1),
        0 0 6px 7px rgba(239, 68, 68, 0.35);
}

.btn-success {
    background-color: #22c55e;
    box-shadow:
        inset 0px 1px 1px rgba(255, 255, 255, 0.3),
        inset 0px -1px 1px rgba(0, 0, 0, 0.1),
        0 0 4px 6px rgba(34, 197, 94, 0.25);
}

.btn-success:hover {
    background-color: #16a34a;
    box-shadow:
        inset 0px 1px 1px rgba(255, 255, 255, 0.4),
        inset 0px -1px 1px rgba(0, 0, 0, 0.1),
        0 0 6px 7px rgba(34, 197, 94, 0.35);
}

.btn-secondary {
    background-color: #6b7280;
    box-shadow:
        inset 0px 1px 1px rgba(255, 255, 255, 0.3),
        inset 0px -1px 1px rgba(0, 0, 0, 0.1),
        0 0 4px 6px rgba(107, 114, 128, 0.25);
}

.btn-secondary:hover {
    background-color: #4b5563;
    box-shadow:
        inset 0px 1px 1px rgba(255, 255, 255, 0.4),
        inset 0px -1px 1px rgba(0, 0, 0, 0.1),
        0 0 6px 7px rgba(107, 114, 128, 0.35);
}

.btn:active {
    transform: scale(0.98) translateY(1px);
    box-shadow:
        inset 0px 2px 3px rgba(0, 0, 0, 0.2);
}

.btn-lg {
    font-size: 1.2rem;
    padding: 1rem 2rem;
}

.btn-sm {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
}

.btn-outline {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff;
    transform: translateY(-2px);
}

/* Cards and Panels */
.card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.card-header {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #ffffff;
}

.card-body {
    color: rgba(255, 255, 255, 0.8);
}

/* Status Indicators */
.status {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.875rem;
}

.status-active {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.status-inactive {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.status-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 0.9);
}

.form-input,
.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #ffffff;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s ease;
}

.form-select {
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5rem 1.5rem;
    padding-right: 2.5rem;
}

.form-select option {
    background: #18181B;
    color: #ffffff;
    padding: 0.5rem;
}

/* Fix for Firefox dropdown */
.form-select::-moz-color-swatch,
.form-select::-moz-color-swatch-wrapper {
    border: none;
    background: transparent;
}

/* Fix for WebKit browsers */
.form-select::-webkit-scrollbar {
    width: 8px;
}

.form-select::-webkit-scrollbar-track {
    background: #18181B;
}

.form-select::-webkit-scrollbar-thumb {
    background: #21b4c0;
    border-radius: 4px;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: #21b4c0;
    box-shadow: 0 0 0 3px rgba(33, 180, 192, 0.1);
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* Authentication Forms */
#authFormsContainer {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-input[type="checkbox"] {
    width: auto;
    height: auto;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    padding: 0;
    margin: 0;
    cursor: pointer;
}

.form-input[type="checkbox"]:checked {
    background-color: #21b4c0;
    border-color: #21b4c0;
}

.form-input[type="checkbox"]:checked::before {
    content: '✓';
    display: block;
    color: white;
    font-size: 12px;
    text-align: center;
    line-height: 1;
    padding: 2px;
}

/* Loading state for buttons */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* Toggle Switch */
.toggle {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.2);
    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%;
}

.toggle input:checked + .toggle-slider {
    background-color: #21b4c0;
}

.toggle input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

/* Grid System */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: -1rem;
}

.col {
    flex: 1;
    padding: 1rem;
}

.col-2 {
    flex: 0 0 50%;
    max-width: 50%;
    padding: 1rem;
}

.col-3 {
    flex: 0 0 33.333%;
    max-width: 33.333%;
    padding: 1rem;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.hidden {
    display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 0.5rem;
    }
    
    .container {
        padding: 1rem 0.5rem;
    }
    
    .col-2,
    .col-3 {
        flex: 0 0 100%;
        max-width: 100%;
        padding: 0.5rem;
    }
    
    .row {
        margin: -0.5rem;
    }
    
    .col {
        padding: 0.5rem;
    }
    
    /* Make cards take full width with minimal padding on mobile */
    .card {
        margin-left: 0;
        margin-right: 0;
        padding: 1rem;
    }
    
    /* Ensure buttons and form elements are properly sized */
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .btn-sm {
        width: auto;
        display: inline-block;
    }
    
    /* Improve form layout on mobile */
    .form-group {
        margin-bottom: 1rem;
    }
    
    /* Better spacing for mobile */
    .main-content {
        padding: 0.25rem;
    }
    
    .container {
        max-width: 100%;
        padding: 0.5rem;
    }
    
    /* Mobile page titles - center and add top margin to avoid menu collision */
    .main-content h1 {
        text-align: center;
        margin-top: 3rem;
        margin-bottom: 2rem;
        font-size: 1.5rem;
        padding: 0 1rem;
    }
    
    /* Mobile menu toggle button */
    .menu-toggle {
        position: fixed;
        top: 1rem;
        left: 1rem;
        z-index: 10001;
        background: #21b4c0;
        color: white;
        border: none;
        padding: 0.5rem;
        border-radius: 8px;
        font-size: 1.2rem;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s ease;
    }
    
    /* Hide menu toggle when sidebar is active */
    .menu-toggle.hidden {
        opacity: 0;
        pointer-events: none;
        transform: scale(0.8);
    }
    
    /* Close button style inside sidebar */
    .sidebar .close-btn {
        position: absolute;
        top: 1rem;
        right: 1rem;
        background: transparent;
        color: rgba(255, 255, 255, 0.7);
        border: none;
        font-size: 1.5rem;
        width: 30px;
        height: 30px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        border-radius: 4px;
        transition: all 0.2s ease;
    }
    
    .sidebar .close-btn:hover {
        background: rgba(255, 255, 255, 0.1);
        color: white;
    }
}

/* Authentication Background Override */
#main-content > div[style*="background: #18181B"] {
    background: transparent !important;
}

/* Auth form container improvements */
#main-content div[style*="rgba(255,255,255,0.05)"] {
    background: rgba(24, 24, 27, 0.85) !important;
    backdrop-filter: blur(15px) !important;
    border: 1px solid rgba(255,255,255,0.15) !important;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3) !important;
}