/* Admin Portal Styles */

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

:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --danger-color: #dc2626;
    --success-color: #16a34a;
    --warning-color: #ea580c;
    --bg-color: #f8fafc;
    --sidebar-bg: #1e293b;
    --card-bg: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --primary-gold: #d4af37;
    --dark-blue: #0a1929;
    --light-blue: #1e3a5f;
    --accent-teal: #2dd4bf;
    --white: #ffffff;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Site Header (shared with main site) */
header {
    background: linear-gradient(135deg, #0a1929 0%, #1a2f45 50%, #0a1929 100%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 2px solid rgba(212, 175, 55, 0.3);
}

.header-content {
    margin: 0 auto;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.water-logo-container {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, var(--dark-blue) 0%, var(--light-blue) 100%);
    border-radius: 20px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    border: 2px solid var(--primary-gold);
}

.water-logo-container:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 30px rgba(212, 175, 55, 0.4);
}

.wave-shape {
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 250%;
    height: 40px;
    background: rgba(212, 175, 55, 0.2);
    border-radius: 40% 50% 0 0;
    animation: waveAnimation 8s linear infinite;
    opacity: 0.8;
}

.wave-1 {
    animation-delay: 0s;
    height: 35px;
    background: rgba(212, 175, 55, 0.15);
    left: -50%;
}

.wave-2 {
    animation-delay: -3s;
    height: 45px;
    background: rgba(212, 175, 55, 0.25);
}

.wave-3 {
    animation-delay: -6s;
    height: 40px;
    background: rgba(212, 175, 55, 0.2);
    left: -25%;
}

@keyframes waveAnimation {
    0% {
        transform: translateX(0) rotateZ(0deg);
    }

    50% {
        transform: translateX(-50%) rotateZ(2deg);
    }

    100% {
        transform: translateX(0) rotateZ(0deg);
    }
}

.water-logo-container .logo-text {
    position: relative;
    z-index: 10;
    color: var(--primary-gold);
    font-size: 1.5em;
    font-weight: 700;
    letter-spacing: 0;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
    user-select: none;
}

.logo > .logo-text {
    display: flex;
    flex-direction: column;
}

.logo-text .brand {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.logo-text .tagline {
    font-size: 0.75rem;
    color: var(--primary-gold);
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2.5rem;
}

nav a {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.5rem 0;
}

nav a:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-gold) 0%, var(--accent-teal) 100%);
    transition: width 0.3s ease;
}

nav a:hover {
    color: var(--primary-gold);
}

nav a:hover:after {
    width: 100%;
}

.cta-button {
    background: linear-gradient(135deg, var(--primary-gold) 0%, #e6c14a 100%);
    color: var(--dark-blue);
    padding: 0.8rem 2rem;
    border-radius: 30px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
    font-size: 0.9rem;
    border: 1px solid rgba(212, 175, 55, 0.5);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(212, 175, 55, 0.6);
    background: linear-gradient(135deg, #e6c14a 0%, var(--primary-gold) 100%);
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 120px);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-card h1 {
    font-size: 28px;
    margin-bottom: 8px;
    text-align: center;
}

.login-card .subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

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

.password-input-wrapper input {
    width: 100%;
    padding-right: 45px;
}

.password-toggle {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.password-toggle:hover {
    opacity: 1;
}

.eye-icon {
    display: block;
    user-select: none;
}

/* Admin Layout */
.admin-layout {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 100vh;
    width: 100%;
}

@media (min-width: 1024px) {
    .admin-layout {
        grid-template-columns: 250px minmax(0, 1fr);
    }
}

.sidebar {
    width: 100%;
    background: var(--sidebar-bg);
    color: white;
    padding: 24px 0;
    position: sticky;
    top: 0;
    min-height: 100vh;
    max-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 4px 0 16px rgba(15, 23, 42, 0.55);
    display: flex;
    flex-direction: column;
}

@media (min-width: 1024px) {
    .sidebar {
        width: 250px;
    }
}

@media (max-width: 1023px) {
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        z-index: 1000;
        width: 250px;
        transition: left 0.3s ease;
    }
    
    .sidebar.mobile-open {
        left: 0;
    }
}

.sidebar-header {
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    font-size: 20px;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    line-height: 1;
}

@media (max-width: 1023px) {
    .mobile-menu-toggle {
        display: block;
    }
}

.mobile-menu-open-btn {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 999;
    background: var(--sidebar-bg);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

@media (min-width: 1024px) {
    .mobile-menu-open-btn {
        display: none !important;
    }
}

@media (max-width: 1023px) {
    .mobile-menu-open-btn {
        display: block;
    }
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

@media (max-width: 1023px) {
    .sidebar-overlay.show {
        display: block;
    }
}

.nav-menu {
    list-style: none;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

.nav-menu li {
    margin: 0;
    width: 100%;
}

.nav-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    position: relative;
    width: 100%;
}

.nav-menu a:hover,
.nav-menu a.active {
    background: linear-gradient(90deg, rgba(148, 163, 184, 0.35), rgba(15, 23, 42, 0));
    color: white;
}

.nav-menu a::before {
    content: '';
    width: 4px;
    height: 0;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--primary-gold), var(--accent-teal));
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    transition: height 0.18s ease-out;
}

.nav-menu a:hover::before,
.nav-menu a.active::before {
    height: 70%;
}

.main-content {
    flex: 1;
    padding: 16px 20px;
    min-width: 0;
    background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.09), transparent 55%), radial-gradient(circle at bottom right, rgba(37, 99, 235, 0.08), transparent 55%);
}

@media (max-width: 1023px) {
    .main-content {
        padding: 16px 20px;
    }
}

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

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

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

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    background: transparent;
    box-shadow: none;
    position: relative;
    top: auto;
    z-index: auto;
    border-bottom: none;
    padding: 0 0 24px;
}

@media (max-width: 1023px) {
    .page-header {
        padding-left: 50px;
    }
}

.page-header h1 {
    font-size: 32px;
}

.user-info {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.04);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.user-info span {
    font-weight: 600;
    color: var(--text-primary);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input[type="file"] {
    padding: 8px;
    cursor: pointer;
}

.file-upload-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.file-upload-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 2;
}

.file-upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    border: 2px dashed var(--border-color);
    border-radius: 6px;
    background: var(--bg-color);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    min-height: 120px;
}

.file-upload-label:hover {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

.file-upload-label.has-file {
    border-color: var(--success-color);
    background: rgba(22, 163, 74, 0.05);
}

.file-upload-text {
    color: var(--text-secondary);
    font-size: 14px;
}

.file-upload-text strong {
    color: var(--primary-color);
}

.image-preview-container {
    margin-top: 12px;
    display: none;
}

.image-preview-container.show {
    display: block;
}

.image-preview {
    position: relative;
    display: inline-block;
    max-width: 300px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.image-preview img {
    width: 100%;
    height: auto;
    display: block;
}

.image-preview-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(220, 38, 38, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.image-preview-remove:hover {
    background: var(--danger-color);
}

.file-info {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group.checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group.checkbox input[type="checkbox"] {
    width: auto;
    margin: 0;
    cursor: pointer;
}

.form-group.checkbox label {
    margin: 0;
    font-weight: normal;
    cursor: pointer;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 768px) {
    .form-row {
        grid-template-columns: 1fr 1fr;
    }
}

.error-text {
    display: block;
    color: var(--danger-color);
    font-size: 12px;
    margin-top: 4px;
}

.error-message {
    background: #fee2e2;
    color: var(--danger-color);
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

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

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-loader {
    display: inline-block;
}

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 40px;
}

@media (min-width: 640px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stat-card {
    background: var(--card-bg);
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stat-card h3 {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
}

.quick-actions {
    background: var(--card-bg);
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.quick-actions h2 {
    font-size: 20px;
    margin-bottom: 20px;
}

.action-buttons {
    display: flex;
    gap: 12px;
}

/* Products Table */
.filters {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.search-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.filter-select {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    min-width: 200px;
}

.table-container {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    overflow-x: auto;
    max-width: 100%;
}

.products-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.products-table th {
    background: var(--bg-color);
    padding: 12px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-secondary);
}

.products-table td {
    padding: 12px;
    border-top: 1px solid var(--border-color);
}

.products-table tbody tr:hover {
    background: var(--bg-color);
}

.product-thumbnail {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

.actions {
    display: flex;
    gap: 8px;
}

.loading,
.empty,
.error {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

/* Product Form */
.product-form {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    max-width: 800px;
}

.feature-input {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.feature-field {
    flex: 1;
}

.btn-remove-feature {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--danger-color);
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 30px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 8px;
    max-width: 400px;
    width: 90%;
}

@media (max-width: 640px) {
    .modal-content {
        padding: 20px;
    }
}

.modal-content h2 {
    margin-bottom: 16px;
}

.modal-content p {
    margin-bottom: 24px;
    color: var(--text-secondary);
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--card-bg);
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s;
    z-index: 1000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-success {
    border-left: 4px solid var(--success-color);
}

.toast-error {
    border-left: 4px solid var(--danger-color);
}

.toast-info {
    border-left: 4px solid var(--primary-color);
}

/* Responsive */
@media (max-width: 768px) {
    .main-content {
        padding: 16px 20px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .filters {
        flex-direction: column;
    }
    
    .filter-select {
        width: 100%;
    }
    
    .action-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .action-buttons .btn {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .product-form {
        padding: 20px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}
