/* ==========================================================================
   SmartForm - Main Stylesheet
   Theme: Elegant SaaS & Form Builder
   Direction: LTR (Left-to-Right)
   ========================================================================== */

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');

:root {
    --primary: #03b6f7;
    --primary-dark: #01516c;
    --secondary: #ec4899;
    --dark-bg: #01212d;
    --light-bg: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #334155;
    --text-muted: #94a3b8;
    --radius: 20px;
    --shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.05);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--light-bg);
    color: var(--text-main);
    overflow-x: hidden;
    direction: ltr;
    margin: 0;
}

#wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
}

/* ==========================================================================
   1. DESKTOP SIDEBAR
   ========================================================================== */
#sidebar-wrapper {
    min-width: 260px;
    max-width: 260px;
    background: var(--dark-bg);
    color: #fff;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    padding: 20px;
    box-shadow: 5px 0 20px rgba(0, 0, 0, 0.05);
}

/* Content wrapper spacing */
#page-content-wrapper {
    width: 100%;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 15px;
    transition: all 0.3s ease;
}

@media (min-width: 992px) {
    #page-content-wrapper {
        margin-left: 260px !important;
        margin-right: 0 !important;
        padding: 30px;
    }
}

/* Sidebar Heading */
.sidebar-heading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 25px 15px;
    margin-bottom: 25px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    box-shadow: 0 8px 25px -10px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.sidebar-heading:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 15px 35px -10px rgba(3, 182, 247, 0.15);
}

.sidebar-heading img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-bottom: 12px;
    filter: drop-shadow(0 0 10px rgba(3, 182, 247, 0.4));
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sidebar-heading:hover img {
    transform: scale(1.1) rotate(5deg);
}

.brand-text {
    font-family: 'Inter', sans-serif;
    font-size: 1.25rem;
    font-weight: 900;
    letter-spacing: 1.5px;
    line-height: 1.2;
    background: linear-gradient(to bottom, #ffffff 20%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   2. NAVIGATION ITEMS
   ========================================================================== */
.mobile-nav-item {
    display: flex;
    align-items: center;
    padding: 10px 18px;
    margin-bottom: 6px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s;
    opacity: 1;
    transform: none;
    color: rgba(255, 255, 255, 0.7);
    background: transparent;
    border: 1px solid transparent;
}

.mobile-nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    padding-left: 23px;
}

.mobile-nav-item.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.mobile-nav-item i {
    width: 28px;
    font-size: 1.1rem;
}

/* ==========================================================================
   3. MOBILE SIDEBAR
   ========================================================================== */
@media (max-width: 991px) {
    #sidebar-wrapper {
        margin-left: 0;
        left: -320px;
        right: auto;
        width: 300px;
        max-width: 85%;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        box-shadow: 10px 0 40px rgba(0, 0, 0, 0.1);
        border-right: 1px solid rgba(255, 255, 255, 0.5);
        border-radius: 0 30px 30px 0;
        transition: left 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
        z-index: 9999;
        display: block;
        padding-top: 220px;
        padding-left: 20px;
        padding-right: 20px;
        position: fixed;
    }

    #sidebar-wrapper.active {
        left: 0 !important;
        right: auto !important;
    }

    #page-content-wrapper {
        margin-left: 0;
        margin-right: 0;
        padding: 15px;
    }

    .sidebar-close-btn {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }

    #sidebar-wrapper .sidebar-heading {
        position: absolute;
        top: 25px;
        left: 0;
        right: 0;
        margin: 0 auto;
        width: fit-content;
        background: transparent;
        border: none;
        box-shadow: none;
        backdrop-filter: none;
        padding: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 10px;
        z-index: 10002;
    }

    #sidebar-wrapper .sidebar-heading img {
        width: 100px;
        height: 100px;
        object-fit: contain;
        margin-bottom: 0;
        filter: none;
    }

    #sidebar-wrapper .brand-text {
        font-size: 1.5rem;
        font-weight: 900;
        display: block;
        background: none;
        text-shadow: none;
    }

    .mobile-nav-item {
        display: flex;
        width: 100%;
        color: #475569;
        background: rgba(255, 255, 255, 0.5);
        border: 1px solid rgba(255, 255, 255, 0.8);
        margin-bottom: 12px;
        padding: 16px 20px;
        opacity: 0;
        transform: translateX(-20px);
    }

    #sidebar-wrapper.active .mobile-nav-item {
        opacity: 1;
        transform: translateX(0);
    }

    #sidebar-wrapper.active .mobile-nav-item:nth-child(1) { transition-delay: 0.1s; }
    #sidebar-wrapper.active .mobile-nav-item:nth-child(2) { transition-delay: 0.2s; }
    #sidebar-wrapper.active .mobile-nav-item:nth-child(3) { transition-delay: 0.3s; }
    #sidebar-wrapper.active .mobile-nav-item:nth-child(4) { transition-delay: 0.4s; }

    .mobile-nav-item:hover {
        background: white;
        color: var(--primary);
        transform: scale(1.02);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    }

    .mobile-nav-item.active {
        box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
    }
}

/* ==========================================================================
   4. OVERLAY
   ========================================================================== */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ==========================================================================
   5. GENERAL COMPONENTS
   ========================================================================== */
.modern-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.modern-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -10px rgba(99, 102, 241, 0.15);
}

.btn-primary-custom {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 12px;
    padding: 10px 20px;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    transition: all 0.3s;
}

.btn-primary-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
    color: white;
}

.icon-box {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-right: 15px;
}

.bg-soft-primary {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.branches-container {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.branch-group {
    background-color: #f8fafc;
    border-left: 4px solid #6366f1;
    border-radius: 0 8px 8px 0;
    padding: 20px;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.branch-header {
    font-size: 0.85rem;
    color: #6366f1;
    font-weight: bold;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #e0e7ff;
    padding: 5px 10px;
    border-radius: 6px;
    width: fit-content;
}

.animate-up {
    animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   6. PROJECT CARD (LEGACY & ELEGANT SAAS STYLE)
   ========================================================================== */
.project-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: rgba(3, 182, 247, 0.3);
}

.card-body-custom {
    padding: 20px;
    flex: 1;
}

.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.card-title-text {
    font-size: 1.1rem;
    font-weight: 800;
    color: #1e293b;
    line-height: 1.4;
}

.main-actions-row {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.btn-fill-form {
    flex: 1;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white !important;
    border-radius: 10px;
    padding: 10px 15px;
    text-align: center;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.95rem;
    box-shadow: 0 4px 12px rgba(3, 182, 247, 0.25);
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-fill-form:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(3, 182, 247, 0.35);
}

.btn-design-outline {
    width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    color: #64748b;
    text-decoration: none;
    transition: all 0.2s;
    background: white;
}

.btn-design-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #f0f9ff;
}

.utility-row {
    display: flex;
    justify-content: space-between;
    padding-top: 15px;
    border-top: 1px solid #f1f5f9;
}

.util-btn {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 5px;
    transition: color 0.2s;
}

.util-btn:hover { color: var(--primary); }
.util-btn.delete:hover { color: #ef4444; }

.btn-view-data-footer {
    background: #f8fafc;
    color: #475569;
    text-align: center;
    padding: 14px;
    text-decoration: none;
    font-weight: 700;
    border-top: 1px solid #e2e8f0;
    transition: all 0.3s;
    display: block;
    width: 100%;
}

.btn-view-data-footer:hover {
    background: var(--dark-bg);
    color: #00f3ff;
}

/* ==========================================================================
   7. ELEGANT SAAS CARD DESIGN
   ========================================================================== */
.project-card-elegant {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.project-card-elegant:hover {
    transform: translateY(-5px);
    border-color: var(--card-color) !important;
    box-shadow: 0 10px 20px -5px var(--card-color) !important;
}

.project-card-elegant .fill-btn {
    color: #ffffff !important;
    transition: all 0.3s ease;
}

.project-card-elegant .fill-btn:hover {
    filter: brightness(1.15);
    transform: scale(1.02);
}

.elegant-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.elegant-icon {
    width: 45px;
    height: 45px;
    background: #f8fafc;
    color: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    border: 1px solid #f1f5f9;
}

.elegant-status {
    font-size: 0.75rem;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
}

.elegant-status.active {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.elegant-status.paused {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.elegant-body {
    flex-grow: 1;
    margin-bottom: 24px;
}

.elegant-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 8px 0;
    line-height: 1.5;
}

.elegant-date {
    font-size: 0.85rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 6px;
}

.elegant-btn-main {
    flex: 1;
    padding: 10px 16px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
}

.fill-btn {
    background: #0f172a;
    color: #ffffff;
}

.fill-btn:hover {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(3, 182, 247, 0.2);
}

.data-btn {
    background: #ffffff;
    color: #334155;
    border-color: #e2e8f0;
}

.data-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
}

.elegant-actions-secondary {
    display: flex;
    gap: 8px;
    border-top: 1px dashed #e2e8f0;
}

.elegant-btn-icon {
    width: 38px;
    height: 38px;
    background: transparent;
    color: #64748b;
    border: 1px solid transparent;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    cursor: pointer;
    text-decoration: none;
}

.elegant-btn-icon:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #e2e8f0;
}

.elegant-btn-icon.delete:hover {
    background: #fef2f2;
    color: #ef4444;
    border-color: #fecaca;
}

/* ==========================================================================
   8. RESPONSIVE & LANDSCAPE FIXES
   ========================================================================== */
@media (min-width: 768px) {
    .sidebar-overlay {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
}

@media (max-height: 576px) and (orientation: landscape) {
    #sidebar-wrapper {
        width: 250px;
        overflow-y: auto !important;
        padding-bottom: 50px;
    }

    .sidebar-heading {
        padding: 10px !important;
    }

    .sidebar-heading img {
        width: 50px !important;
        height: 50px !important;
        margin-bottom: 5px !important;
    }

    .list-group-item {
        padding: 10px 15px !important;
    }
}

@media (max-width: 991px) {
    #wrapper {
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        overflow-x: hidden !important;
    }
    
    #page-content-wrapper {
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}