/* CSS Reset for consistent browser styling */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* === Customer Frontend (Home Page) === */
body {
    font-family: Arial, sans-serif;
    background-image: url('../images/home_bg.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: #333;
}

/* Header & Footer */
header, footer {
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    position: fixed;
    width: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
}

header {
    top: 0;
}

footer {
    bottom: 0;
    text-align: center;
    font-size: 0.9em;
}

.header-logo {
    height: 40px;
    width: auto;
    margin-right: 10px;
    vertical-align: middle;
}

header h1 {
    display: inline-block;
    vertical-align: middle;
    font-size: 1.4em;
}

/* Main Content */
main {
    flex: 1;
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    padding-top: 60px;
    padding-bottom: 40px;
    overflow-y: auto;
}

.main-container {
    width: 90%;
    max-width: 1200px;
    padding: 15px;
}

.content-left {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 420px;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.85);
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* Form Container (Click to Order) */
.form-container {
    text-align: center;
    padding: 15px;
    border-radius: 8px;
}

.form-icon {
    width: 90px;
    height: auto;
    cursor: pointer;
    transition: transform 0.3s ease;
    border-radius: 50%;
}

.form-icon:hover {
    transform: scale(1.1);
}

/* Login Container */
.login-container {
    background-color: rgba(255, 255, 255, 0.9);
    padding: 18px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.login-container h2 {
    margin-bottom: 15px;
    font-size: 1.2em;
    color: #2c3e50;
}

.login-container input {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.95em;
}

.login-container button {
    background-color: #2c3e50;
    color: white;
    padding: 10px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    font-size: 1em;
}

.login-container button:hover {
    background-color: #1a252f;
}

/* Contact Info */
.contact-info {
    background-color: rgba(255, 255, 255, 0.9);
    padding: 15px;
    border-radius: 8px;
    font-size: 0.9em;
}

.map-container {
    margin: 10px 0;
    border-radius: 8px;
    overflow: hidden;
}

.map-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

.whatsapp-link {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 15px;
    background-color: #25D366;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: bold;
    font-size: 0.9em;
}

.whatsapp-link:hover {
    background-color: #128C7E;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 25px;
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    position: relative;
}

.close-btn {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    z-index: 20;
}

.close-btn:hover {
    color: #000;
}

/* Animated Character (Centered, Larger, Floating) */
.animated-character {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.3);
    font-size: 40px;
    animation: float 3s ease-in-out infinite;
    cursor: help;
    z-index: 10;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    border: 2px solid #f0f0f0;
}

@keyframes float {
    0% { transform: translate(-50%, -50%) scale(1.3) rotate(0deg); }
    50% { transform: translate(-50%, -60%) scale(1.4) rotate(10deg); }
    100% { transform: translate(-50%, -50%) scale(1.3) rotate(0deg); }
}

/* Form Sections */
.form-section {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.form-section h3 {
    margin: 0 0 12px 0;
    color: #2c3e50;
    font-size: 1.15em;
    font-weight: 600;
}

/* Section Divider (Thin Double Line) */
.section-divider {
    height: 6px;
    margin: 20px 0;
    border-top: 1px double #ddd;
    border-bottom: 1px double #eee;
    background: linear-gradient(to right, transparent, #ccc 20%, #ccc 80%, transparent);
}

/* Form Group */
.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #444;
    font-size: 0.95em;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1em;
    background-color: white;
}

.form-group input[readonly] {
    background-color: #f5f5f5;
    color: #555;
}

/* Garment Table */
.garment-table-container {
    margin: 18px 0;
}

#garment-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
}

#garment-table th,
#garment-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
}

#garment-table th {
    background-color: #f2f2f2;
    font-weight: 600;
    color: #333;
}

#garment-table input {
    width: 100%;
    padding: 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9em;
}

/* Action Button (Delete Row) */
#garment-table .delete-row-btn {
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 14px;
    cursor: pointer;
    margin: 0;
}

#garment-table .delete-row-btn:hover {
    background-color: #c0392b;
}

/* Add Another Column Button */
#add-item-btn {
    background-color: #2c3e50;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95em;
    margin: 10px 0;
}

#add-item-btn:hover {
    background-color: #1a252f;
}

/* File Upload Group */
.file-upload-group {
    margin: 20px 0;
}

.file-upload-group label {
    font-weight: 600;
    color: #2c3e50;
}

.file-info {
    font-size: 0.85em;
    color: #555;
    margin: 5px 0;
    line-height: 1.4;
}

#design_files {
    margin-top: 6px;
    width: 100%;
}

/* Submit Button */
#orderForm button[type="submit"] {
    background-color: #e74c3c;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 1.05em;
    cursor: pointer;
    display: block;
    width: 100%;
    margin-top: 15px;
    font-weight: bold;
}

#orderForm button[type="submit"]:hover {
    background-color: #c0392b;
}

/* Loading Overlay */
#loadingOverlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 9999;
}

.spinner {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #3498db;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success Message */
.success-message-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    background-image: url('../images/home_bg.jpg');
    background-size: cover;
    color: white;
    font-size: 1.2rem;
    z-index: 1000;
}

.success-message-container .container {
    background-color: rgba(0, 0, 0, 0.7);
    padding: 40px;
    border-radius: 10px;
}

.success-message-container .countdown-text {
    margin-top: 20px;
}

/* === Admin Dashboard Styles === */
body.dashboard-light {
    background-color: #f4f6f9;
    background-image: none !important;
    margin: 0;
    padding: 0;
}

/* Sidebar - Fixed Left, Dark Grey */
.sidebar {
    width: 250px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: #2c3e50;
    color: white;
    padding: 20px 0;
    overflow-y: auto;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    z-index: 1000;
}

.sidebar .logo {
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.4em;
    font-weight: bold;
}

.sidebar .menu a {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    color: #ecf0f1;
    text-decoration: none;
    font-size: 0.95em;
    transition: 0.3s;
}

.sidebar .menu a:hover,
.sidebar .menu a.active {
    background: #34495e;
    border-left: 4px solid #e74c3c;
}

.sidebar .menu a i {
    width: 30px;
    font-size: 1.1em;
}

/* Main Content - Right of Sidebar */
.main-content {
    margin-left: 250px;
    padding: 30px;
    background: #ffffff;
    min-height: 100vh;
    box-sizing: border-box;
}

.main-content header.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.top-bar h1 {
    color: #2c3e50;
    font-size: 1.6em;
}

.user-info {
    font-size: 0.95em;
    color: #555;
}

/* Stats Cards */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #f8f9fa;
    padding: 20px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-card i {
    font-size: 2em;
    color: #3498db;
}

.stat-card h3 {
    font-size: 1.8em;
    color: #2c3e50;
}

.stat-card p {
    color: #6c757d;
    margin: 0;
}

/* Data Section */
.data-section {
    margin-bottom: 30px;
}

.data-section h2 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 1.3em;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.data-table th {
    background-color: #f8f9fa;
    color: #495057;
    font-weight: 600;
}

.data-table tr:last-child td {
    border-bottom: none;
}

/* Status Badges */
.status {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 500;
}

.status.pending {
    background: #f39c12;
    color: white;
}

.status.processing {
    background: #3498db;
    color: white;
}

.status.completed {
    background: #27ae60;
    color: white;
}

/* Pagination */
.pagination {
    margin-top: 20px;
    text-align: center;
    font-size: 0.95em;
    color: #555;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.pagination .btn-pagination {
    background: #2c3e50;
    color: white;
    padding: 8px 15px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9em;
}

.pagination .btn-pagination:hover {
    background: #1a252f;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-container {
        width: 95%;
        padding: 10px;
    }

    .content-left {
        max-width: 100%;
        padding: 15px;
    }

    .modal-content {
        width: 95%;
        padding: 20px;
    }

    .form-section {
        padding: 12px;
    }

    #garment-table th,
    #garment-table td {
        padding: 6px;
        font-size: 0.85em;
    }

    .form-group input,
    .form-group select {
        padding: 9px;
        font-size: 0.95em;
    }

    .close-btn {
        font-size: 26px;
    }

    .animated-character {
        font-size: 36px;
        width: 55px;
        height: 55px;
    }

    /* Dashboard Responsive */
    .sidebar {
        width: 200px;
    }
    .main-content {
        margin-left: 200px;
    }
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .form-section h3 {
        font-size: 1.05em;
    }

    .file-info {
        font-size: 0.8em;
    }

    #add-item-btn,
    #orderForm button[type="submit"] {
        padding: 10px;
        font-size: 0.9em;
    }

    .animated-character {
        font-size: 32px;
        width: 50px;
        height: 50px;
    }

    #garment-table .delete-row-btn {
        font-size: 12px;
        padding: 3px 6px;
    }
}