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

:root {
    --primary: #10B981;
    --primary-dark: #059669;
    --secondary: #3B82F6;
    --dark: #0F172A;
    --dark-light: #1E293B;
    --gray: #64748B;
    --light: #F1F5F9;
    --white: #FFFFFF;
    --danger: #EF4444;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--light);
    color: var(--dark);
    min-height: 100vh;
}

/* Login Section */
#login-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark), var(--secondary));
    padding: 20px;
}

.login-container {
    background: var(--white);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    position: relative;
}

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

.login-header .logo {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    margin-bottom: 16px;
}

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

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

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

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.error-message {
    color: var(--danger);
    font-size: 14px;
    margin-bottom: 16px;
    display: none;
}

.error-message:not(:empty) {
    display: block;
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

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

.btn-secondary {
    padding: 10px 20px;
    background: var(--white);
    color: var(--dark);
    border: 2px solid #E5E7EB;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-danger {
    padding: 10px 20px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

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

/* Language Selector */
.lang-selector {
    position: absolute;
    top: 16px;
    right: 16px;
}

.lang-selector select {
    padding: 8px 12px;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    font-size: 14px;
    background: var(--white);
    cursor: pointer;
    transition: all 0.2s;
}

.lang-selector select:hover {
    border-color: var(--primary);
}

.lang-selector select:focus {
    outline: none;
    border-color: var(--primary);
}

.lang-select-small {
    padding: 6px 10px;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    background: var(--white);
    cursor: pointer;
    transition: all 0.2s;
}

.lang-select-small:hover {
    border-color: var(--primary);
}

.lang-select-small:focus {
    outline: none;
    border-color: var(--primary);
}

.back-link {
    display: block;
    text-align: center;
    margin-top: 24px;
    color: var(--gray);
    text-decoration: none;
    font-size: 14px;
}

.back-link:hover {
    color: var(--primary);
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Dashboard Section */
#dashboard-section {
    min-height: 100vh;
}

.header {
    background: var(--white);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #E5E7EB;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--dark);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

#user-email {
    color: var(--gray);
    font-size: 14px;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    padding: 24px;
}

.stat-card {
    background: var(--white);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--dark);
}

.stat-label {
    font-size: 14px;
    color: var(--gray);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 8px;
    padding: 0 24px;
    border-bottom: 1px solid #E5E7EB;
    background: var(--white);
}

.tab {
    padding: 16px 24px;
    background: none;
    border: none;
    font-size: 15px;
    font-weight: 500;
    color: var(--gray);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.tab:hover {
    color: var(--dark);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Content */
.content {
    padding: 24px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 200px;
    padding: 12px 16px;
    border: 2px solid #E5E7EB;
    border-radius: 10px;
    font-size: 14px;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
}

.filter-select {
    padding: 12px 16px;
    border: 2px solid #E5E7EB;
    border-radius: 10px;
    font-size: 14px;
    background: var(--white);
    cursor: pointer;
}

/* Items Grid */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.item-card {
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    cursor: pointer;
    transition: all 0.2s;
}

.item-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.1);
}

.item-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: var(--light);
}

.item-image-placeholder {
    width: 100%;
    height: 160px;
    background: var(--light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: #CBD5E1;
}

.item-info {
    padding: 16px;
}

.item-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--dark);
}

.item-subtitle {
    font-size: 14px;
    color: var(--gray);
    margin-bottom: 8px;
}

.item-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

.loading {
    text-align: center;
    padding: 40px;
    color: var(--gray);
    grid-column: 1 / -1;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    grid-column: 1 / -1;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--gray);
}

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

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #E5E7EB;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

.modal-body img {
    width: 100%;
    border-radius: 12px;
    margin-bottom: 16px;
}

.modal-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #F3F4F6;
}

.modal-row:last-child {
    border-bottom: none;
}

.modal-label {
    color: var(--gray);
    font-size: 14px;
}

.modal-value {
    font-weight: 500;
    font-size: 14px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #E5E7EB;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Private Space */
.private-locked {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, #1E293B, #0F172A);
    border-radius: 20px;
    color: white;
}

.lock-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.private-locked h3 {
    font-size: 24px;
    margin-bottom: 12px;
}

.private-locked p {
    color: #94A3B8;
    margin-bottom: 30px;
}

.password-form {
    display: flex;
    gap: 12px;
    max-width: 400px;
    margin: 0 auto;
    flex-wrap: wrap;
    justify-content: center;
}

.password-form input {
    flex: 1;
    min-width: 200px;
}

.password-form .btn-primary {
    width: auto;
    padding: 14px 30px;
}

.private-status {
    color: var(--primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

#private-error {
    margin-top: 16px;
    color: #EF4444;
}

/* Private items (images/videos) */
.private-item-card {
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    cursor: pointer;
    transition: all 0.2s;
}

.private-item-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.1);
}

.private-item-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--light);
}

.private-item-info {
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.private-item-type {
    font-size: 12px;
    padding: 4px 10px;
    background: var(--light);
    border-radius: 20px;
    color: var(--gray);
}

.private-item-date {
    font-size: 12px;
    color: var(--gray);
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .header-right {
        width: 100%;
        justify-content: center;
    }

    #user-email {
        display: none;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        padding: 16px;
    }

    .tabs {
        overflow-x: auto;
        padding: 0 16px;
    }

    .tab {
        padding: 12px 16px;
        font-size: 14px;
        white-space: nowrap;
    }

    .content {
        padding: 16px;
    }

    .toolbar {
        flex-direction: column;
    }

    .items-grid {
        grid-template-columns: 1fr;
    }
}
