/* css/style.css */
:root {
    --primary: #0f172a; /* Slate 900 */
    --secondary: #1e293b; /* Slate 800 */
    --text-primary: #FFFFFF;
    --text-secondary: #94a3b8; /* Slate 400 */
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    --success: #10b981; /* Emerald 500 */
    --error: #FF416C;
    --accent: #FF416C; /* Pink Accent */
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 8px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
}

.glass-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 20px;
    transition: var(--transition);
}

.glass-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: var(--glass-shadow);
}

/* Background Animations for Login */
.login-body {
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.glass-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    z-index: -1;
    animation: float 10s infinite ease-in-out alternate;
}

.orb-1 {
    width: 300px;
    height: 300px;
    background: #00C9FF;
    top: 10%;
    left: 10%;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: #FF416C;
    bottom: -50px;
    right: 5%;
    animation-delay: -5s;
}

.orb-3 {
    width: 200px;
    height: 200px;
    background: #92FE9D;
    top: 40%;
    left: 40%;
    animation-duration: 15s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, 50px) scale(1.1); }
}

/* Login Form */
.login-container {
    width: 100%;
    max-width: 400px;
    padding: 40px;
    z-index: 10;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.input-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon-wrapper i {
    position: absolute;
    left: 16px;
    color: rgba(255, 255, 255, 0.6);
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    padding: 12px 16px 12px 45px; /* left padding for icon */
    color: white;
    font-size: 16px;
    outline: none;
    transition: var(--transition);
}

/* Base Inputs without icons */
.form-control {
    padding: 12px 16px;
}

input:focus, select:focus, textarea:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

input::placeholder, textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* Buttons */
.btn-primary {
    background: linear-gradient(to right, #FF416C, #FF4B2B);
    border: none;
    color: white;
    padding: 14px 24px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(255, 65, 108, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 65, 108, 0.5);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-danger {
    background: linear-gradient(to right, #FF416C, #FF4B2B);
    color: white;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.error-alert {
    background: rgba(255, 65, 108, 0.2);
    border: 1px solid rgba(255, 65, 108, 0.4);
    color: #FFB3C6;
}

/* Layout - Navigation & Content */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
}

.navbar-brand {
    font-size: 24px;
    font-weight: 700;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-links {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover, .nav-links a.active {
    color: white;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
}

.main-content {
    padding: 40px;
    flex: 1;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-title {
    font-size: 32px;
    font-weight: 700;
}

/* Glass Tables */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    color: white;
}

th, td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

th {
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
}

tbody tr {
    transition: var(--transition);
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    transition: var(--transition);
}

.close-btn:hover {
    color: white;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-row .form-group {
    flex: 1;
}

/* Action Buttons */
.btn-action {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin-right: 5px;
}

.btn-action:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.btn-edit { color: #10b981; }
.btn-delete { color: #FF416C; }
.btn-print { color: #e2e8f0; }

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        padding: 15px;
        gap: 15px;
    }

    .nav-links {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .nav-user {
        margin-top: 5px;
    }

    .main-content {
        padding: 15px;
    }

    .page-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .page-header .btn-primary {
        width: 100%;
        justify-content: center;
    }

    .page-title {
        font-size: 24px;
        text-align: center;
    }

    .form-row, .grid-header, .grid-buyer {
        display: flex !important;
        flex-direction: column !important;
        gap: 15px !important;
    }

    .modal-content {
        padding: 20px;
        margin: 10px;
        width: calc(100% - 20px);
        max-height: 85vh;
    }
    
    /* Responsive forms inside modals/pages */
    .form-section {
        padding: 15px;
    }
    
    /* Make tables scrollable smoothly on mobile */
    .table-container {
        padding: 0;
        border-radius: var(--radius-sm);
        -webkit-overflow-scrolling: touch;
        overflow-x: auto;
        margin-bottom: 20px;
    }

    th, td {
        padding: 12px 10px;
        font-size: 13px;
        /* Removed white-space: nowrap to allow inputs to stack properly */
    }
    
    /* Quotation Lines Table specific */
    .lines-table {
        min-width: 800px;
    }
    .lines-table input, .lines-table select {
        min-width: 120px;
        display: block;
        width: 100%;
        margin-bottom: 5px; /* Ensures space between stacked elements */
    }
    
    .login-container {
        padding: 30px 20px;
        width: 90%;
    }
    
    .orb-1, .orb-2, .orb-3 {
        filter: blur(80px); /* reduce harshness on small screens */
    }
}

/* New Login Page Styling */
.login-body {
    background: #0f172a; /* Dark sleek background overriding the global gradient */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
}

.login-page-wrapper {
    width: 100%;
    max-width: 1000px;
    margin: 20px;
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    overflow: hidden;
    backdrop-filter: blur(20px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.login-split {
    display: flex;
    min-height: 550px;
}

/* Left Branding Side */
.login-branding {
    flex: 1;
    background: linear-gradient(135deg, #FF416C 0%, #FF4B2B 100%);
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-branding::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.branding-content {
    position: relative;
    z-index: 2;
    color: white;
}

.branding-content h1 {
    font-size: 42px;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 20px;
    letter-spacing: -1px;
}

.branding-content p {
    font-size: 18px;
    opacity: 0.9;
    margin-bottom: 40px;
}

.branding-features {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.branding-features span {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    font-weight: 500;
    background: rgba(0, 0, 0, 0.2);
    padding: 12px 20px;
    border-radius: 12px;
    backdrop-filter: blur(5px);
}

.branding-features i {
    color: #92FE9D;
    font-size: 20px;
}

/* Right Form Side */
.login-form-side {
    flex: 1;
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: transparent;
}

.login-form-container {
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
}

.login-header-new {
    margin-bottom: 40px;
}

.login-header-new h2 {
    font-size: 28px;
    color: white;
    margin-bottom: 10px;
    font-weight: 700;
}

.login-header-new p {
    color: #94a3b8;
    font-size: 15px;
}

/* Floating label inputs */
.floating-label-group {
    position: relative;
    margin-bottom: 30px;
}

.floating-input {
    width: 100%;
    background: rgba(15, 23, 42, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 12px !important;
    padding: 16px 20px 16px 50px !important;
    color: white !important;
    font-size: 16px !important;
    transition: all 0.3s ease !important;
}

.floating-input:focus {
    border-color: #FF416C !important;
    box-shadow: 0 0 0 4px rgba(255, 65, 108, 0.1) !important;
}

.input-icon-new {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 18px;
    transition: color 0.3s ease;
    z-index: 2;
}

.floating-input:focus ~ .input-icon-new,
.floating-input:not(:placeholder-shown) ~ .input-icon-new {
    color: #FF416C;
}

.floating-label {
    position: absolute;
    left: 50px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    transition: all 0.3s ease;
    font-size: 16px;
    background: transparent;
    padding: 0 4px;
}

.floating-input:focus ~ .floating-label,
.floating-input:not(:placeholder-shown) ~ .floating-label {
    top: 0;
    left: 45px;
    font-size: 12px;
    color: #FF416C;
    background: #1e293b; /* Match container background */
    border-radius: 4px;
}

.btn-login-new {
    width: 100%;
    padding: 16px;
    background: #FF416C;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

.btn-login-new:hover {
    background: #FF4B2B;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -10px rgba(255, 65, 108, 0.5);
}

@media (max-width: 768px) {
    .login-split {
        flex-direction: column;
    }
    
    .login-branding {
        padding: 40px 30px;
        text-align: center;
    }
    
    .branding-content h1 {
        font-size: 32px;
    }
    
    .branding-features {
        align-items: center;
    }
    
    .login-form-side {
        padding: 40px 30px;
    }
}
