/* Global Resets & Styling System */
:root {
    --bg-color: #070a13;
    --card-bg: rgba(15, 23, 42, 0.4);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --primary-gradient: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
    --accent-glow: rgba(0, 242, 254, 0.12);
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --danger-color: #ef4444;
    --danger-gradient: linear-gradient(135deg, #ff6b6b 0%, #ff8787 100%);
    --font-sans: 'Outfit', sans-serif;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-sans);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background Animated Glows */
.bg-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-glow) 0%, rgba(11,15,25,0) 70%);
    top: -100px;
    right: -100px;
    z-index: -1;
    pointer-events: none;
    animation: pulseGlow 10s infinite alternate;
}

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

.container {
    width: 100%;
    max-width: 100vw;
    margin: 0 auto;
    padding: 6rem 1.5rem 1.5rem 1.5rem; /* Top padding increased to prevent fixed header overlap */
    box-sizing: border-box;
}

/* Header Styling (Fixed with Hamburger) */
.main-header {
    border-bottom: 1px solid var(--border-color);
    background: rgba(7, 10, 19, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo i {
    font-size: 1.6rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo h1 {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Hamburger Toggle Button */
.menu-toggle-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: #fff;
    font-size: 1.25rem;
    padding: 0.6rem 0.8rem;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-toggle-btn:hover {
    border-color: #00f2fe;
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.3);
    background: rgba(255, 255, 255, 0.05);
}

/* Side Drawer Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(5, 8, 15, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1010;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Full Screen Menu Overlay */
.sidebar-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    max-width: 100%;
    background: rgba(0, 0, 0, 0.95); /* Deep black background */
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    z-index: 1020;
    padding: 2rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease; /* Smooth fade, no pushing */
    direction: rtl; 
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.sidebar-drawer.open {
    opacity: 1;
    pointer-events: auto;
}

.drawer-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.drawer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.drawer-logo i {
    font-size: 1.5rem;
    color: #00f2fe;
}

.drawer-logo h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
}

.menu-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 2.2rem;
    cursor: pointer;
    line-height: 1;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-close-btn:hover {
    color: #ef4444;
    transform: rotate(90deg);
}

.drawer-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.drawer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    align-items: center;
    text-align: center;
}

.drawer-item {
    border-radius: 12px;
    border: 1px solid transparent;
    transition: var(--transition-smooth);
    width: 100%;
}

.drawer-item a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 1.3rem; /* Larger font for full screen */
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 0.85rem 2rem;
    transition: var(--transition-smooth);
}

.drawer-item a i {
    font-size: 1.4rem;
    color: #4facfe;
    width: 28px;

}

.drawer-item:hover {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.05);
}

.drawer-item:hover a {
    color: #fff;
}

.drawer-item.active {
    background: rgba(0, 242, 254, 0.08);
    border-color: rgba(0, 242, 254, 0.25);
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.05);
}

.drawer-item.active a {
    color: #00f2fe;
    font-weight: 600;
}

.drawer-item.active a i {
    color: #00f2fe;
}


/* Tab Panels Transitions */
.tab-pane {
    display: none;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.tab-pane.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Centered Panels styling */
.form-panel, .settings-panel {
    max-width: 550px;
    margin: 0.5rem auto;
}

.list-panel {
    width: 100%;
}

/* Glassmorphism Panel Base */
.glass-panel {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    transition: var(--transition-smooth);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.glass-panel:hover {
    border-color: var(--border-hover);
}

.panel h2 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
}

.panel h2 i {
    color: #00f2fe;
}

/* Form Styles */
form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-group input[type="text"],
.input-group input[type="tel"],
.input-group input[type="password"],
.input-group select {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    color: #fff;
    font-family: var(--font-sans);
    font-size: 1rem;
    outline: none;
    transition: var(--transition-smooth);
}

.input-group select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='white' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.input-group select option {
    background: #0f172a;
    color: #fff;
}

.input-group input:focus,
.input-group select:focus {
    border-color: #00f2fe;
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 15px var(--accent-glow);
}

/* File Upload Styles */
.file-group {
    position: relative;
}

.file-dropzone {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    position: relative;
    background: rgba(255, 255, 255, 0.01);
    transition: var(--transition-smooth);
    min-height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-dropzone:hover {
    border-color: #00f2fe;
    background: rgba(0, 242, 254, 0.02);
}

.file-dropzone input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

.dropzone-content i {
    font-size: 2rem;
    color: #4facfe;
    margin-bottom: 0.5rem;
}

.dropzone-content p {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.file-name {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.image-preview-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 10px;
    overflow: hidden;
    background: #000;
}

.image-preview-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-image-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(239, 68, 68, 0.9);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: var(--transition-smooth);
    z-index: 10;
}

.remove-image-btn:hover {
    background: var(--danger-color);
    transform: scale(1.1);
}

.hidden {
    display: none !important;
}

/* Button Component */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0.9rem 1.5rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition-smooth);
    width: 100%;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--primary-gradient);
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.3);
}

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

.btn-primary:active {
    transform: translateY(0);
}

.btn-full-width {
    width: 100%;
}

/* Filter Chips (Records Tab) */
.filter-chips {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 2rem;
    overflow-x: auto;
    padding-bottom: 5px;
    direction: rtl; /* Align to right for Kurdish styling */
}

.chip {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 0.5rem 1.25rem;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    font-family: var(--font-sans);
    transition: var(--transition-smooth);
    white-space: nowrap;
}

.chip:hover {
    border-color: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.chip.active {
    background: var(--primary-gradient);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 242, 254, 0.35);
    font-weight: 600;
}

/* Search Tab styling */
.search-tab-box {
    margin-bottom: 2.5rem;
}

.search-box-large {
    position: relative;
    width: 100%;
}

.search-box-large input {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.2rem 1.5rem 1.2rem 3.5rem;
    color: #fff;
    font-family: var(--font-sans);
    font-size: 1.1rem;
    outline: none;
    transition: var(--transition-smooth);
}

.search-box-large input:focus {
    border-color: #00f2fe;
    box-shadow: 0 0 20px var(--accent-glow);
    background: rgba(255, 255, 255, 0.06);
}

.search-icon-large {
    position: absolute;
    left: 1.3rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.25rem;
    pointer-events: none;
}

/* Records Grid */
.records-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* Measurement Card */
.record-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    transition: var(--transition-smooth);
    position: relative;
    display: flex;
    flex-direction: column;
    animation: fadeInCard 0.4s ease-out forwards;
}

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

.record-card:hover {
    transform: translateY(-5px);
    border-color: rgba(0, 242, 254, 0.3);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
    background: rgba(255, 255, 255, 0.04);
}

.card-img-wrapper {
    position: relative;
    width: 100%;
    padding-top: 65%;
    background: #111827;
    overflow: hidden;
    cursor: zoom-in;
}

.card-img-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.record-card:hover .card-img-wrapper img {
    transform: scale(1.05);
}

.card-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex-grow: 1;
}

.card-name-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.card-name {
    font-size: 1.15rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1;
}

.category-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
}

.badge-kurdish {
    background: rgba(0, 242, 254, 0.15);
    color: #00f2fe;
    border: 1px solid rgba(0, 242, 254, 0.3);
}

.badge-pant {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.card-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.card-info i {
    color: #4facfe;
}

.card-footer {
    display: flex;
    gap: 0.75rem;
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    background: rgba(0, 0, 0, 0.1);
}

.btn-card {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border-radius: 8px;
    font-weight: 500;
}

.btn-delete {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.btn-delete:hover {
    background: var(--danger-gradient);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

/* Empty State Styling */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    color: var(--border-hover);
    margin-bottom: 1rem;
}

.empty-state p {
    font-size: 1.1rem;
    font-weight: 500;
    color: #fff;
    margin-bottom: 0.25rem;
}

.empty-state span {
    font-size: 0.9rem;
}

/* Settings View Elements */
.profile-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    border-radius: 16px;
    margin-bottom: 2rem;
}

.profile-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.3);
}

.profile-details h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.2rem;
}

.profile-details p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    padding: 1.2rem 0.75rem;
    border-radius: 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-num {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
}

.text-cyan {
    color: #00f2fe;
}

.text-purple {
    color: #a78bfa;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.settings-actions h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.5rem;
}

.settings-warn {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

/* Password Modal Block overlay */
.password-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(5, 8, 15, 0.96);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.password-modal-content {
    max-width: 420px;
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    border: 1px solid rgba(0, 242, 254, 0.15) !important;
    animation: zoomModal 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.password-icon {
    font-size: 2.5rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.password-modal-content h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
    direction: rtl; /* Kurdish title */
}

.password-modal-content p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.password-input-group {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.password-input-group input {
    text-align: center;
    letter-spacing: 2px;
}

.error-msg {
    color: var(--danger-color);
    font-size: 0.85rem;
    font-weight: 500;
}

/* Image Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 3000;
    padding-top: 100px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(9, 13, 25, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 80%;
    max-height: 75vh;
    border-radius: 12px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    animation: zoomModal 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes zoomModal {
    from {transform: scale(0.9); opacity: 0;}
    to {transform: scale(1); opacity: 1;}
}

.modal-close {
    position: absolute;
    top: 30px;
    right: 50px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: var(--transition-smooth);
    cursor: pointer;
}

.modal-close:hover {
    color: #00f2fe;
}

#modalCaption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    font-size: 1.1rem;
}

/* Responsive tweaks */
@media (max-width: 768px) {
    .stats-container {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 1rem;
    }
    
    .logo h1 {
        font-size: 1.4rem;
    }

    .glass-panel {
        padding: 1.5rem 1rem;
    }
    
    .modal-close {
        right: 25px;
        top: 15px;
    }
}
