/*
 * Components - Reusable UI Components (Samsung-Inspired)
 * Buttons, Cards, Badges, Forms, Navigation, Progress, etc.
 */

/* ===== Buttons ===== */
.btn {
    padding: 12px 28px;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    line-height: 1.4;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn-primary {
    background: #000000;
    color: #ffffff;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    background: #222;
}

.btn-accent {
    background: var(--primary);
    color: #ffffff;
}
.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(20, 40, 160, 0.3);
}

.btn-success {
    background: var(--color-success);
    color: #ffffff;
}
.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 200, 83, 0.3);
}

.btn-danger {
    background: var(--color-danger);
    color: #ffffff;
}
.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 23, 68, 0.3);
}

.btn-info {
    background: var(--color-info);
    color: #ffffff;
}

.btn-warning {
    background: var(--color-warning);
    color: #ffffff;
}

/* Secondary / Outlined buttons (Samsung style) */
.btn-glass {
    background: transparent;
    border: 1px solid #000000;
    color: #000000;
}
.btn-glass:hover {
    background: #000000;
    color: #ffffff;
}

/* Outline buttons */
.btn-outline-danger {
    background: transparent;
    border: 1px solid var(--color-danger);
    color: var(--color-danger);
}
.btn-outline-danger:hover { background: var(--color-danger); color: #ffffff; }

.btn-outline-success {
    background: transparent;
    border: 1px solid var(--color-success);
    color: var(--color-success);
}
.btn-outline-success:hover { background: var(--color-success); color: #ffffff; }

.btn-outline-info {
    background: transparent;
    border: 1px solid var(--color-info);
    color: var(--color-info);
}
.btn-outline-info:hover { background: var(--color-info); color: #ffffff; }

/* Button sizes */
.btn-sm { padding: 8px 18px; font-size: 0.85rem; }
.btn-lg { padding: 16px 36px; font-size: 1.1rem; }
.btn-block { width: 100%; }

/* ===== Glass Card → Clean Card ===== */
.glass-card {
    background: var(--bg-card);
    border-radius: var(--radius-2xl);
    padding: 30px;
    border: none;
    transition: var(--transition);
}

.glass-card-bordered {
    border: 1px solid var(--glass-border);
}

.glass-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

/* No hover transform for cards that shouldn't move */
.glass-card-static:hover {
    transform: none;
    box-shadow: none;
}

/* ===== Page Header ===== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    background: var(--bg-card);
    padding: 24px 32px;
    border-radius: var(--radius-xl);
    border: none;
}

.page-header h1 {
    font-size: 2rem;
    color: var(--text-primary);
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
    background-clip: unset;
}

.page-header-actions {
    display: flex;
    gap: 12px;
}

/* ===== Section Header (centered) ===== */
.section-header {
    text-align: center;
    margin-bottom: 30px;
}

.section-header h1 {
    font-size: 2.5rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.section-header .logo-icon {
    font-size: 4rem;
    margin-bottom: 10px;
    display: block;
    animation: float 3s ease-in-out infinite;
}

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

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

.form-input,
.form-select {
    width: 100%;
    padding: 16px 20px;
    background: #ffffff;
    border: 1px solid #d0d0d0;
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: 'Cairo', sans-serif;
    transition: var(--transition);
    outline: none;
}

.form-input:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(20, 40, 160, 0.1);
}

.form-input::placeholder {
    color: var(--text-muted);
}

textarea.form-input {
    resize: vertical;
    min-height: 60px;
}

.form-select {
    cursor: pointer;
    appearance: none;
}

/* ===== Badges ===== */
.badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: var(--radius-pill);
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-success { background: #e8f5e9; color: #2e7d32; }
.badge-danger { background: #ffebee; color: #c62828; }
.badge-info { background: #e3f2fd; color: #1565c0; }
.badge-warning { background: #fff3e0; color: #e65100; }
.badge-purple { background: #ede7f6; color: #4527a0; }

/* ===== Nav Links (floating) ===== */
.nav-floating {
    position: fixed;
    top: 20px;
    left: 20px;
    display: flex;
    gap: 10px;
    z-index: 100;
}

.nav-floating .btn {
    padding: 10px 20px;
    font-size: 0.9rem;
}

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

.stat-card {
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--radius-xl);
    border: none;
    text-align: center;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.stat-card .stat-icon { font-size: 2.5rem; margin-bottom: 8px; }
.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-primary);
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
    background-clip: unset;
}
.stat-card .stat-label { color: var(--text-secondary); font-size: 0.9rem; }

/* Gold stat value variant */
.stat-card .stat-value-gold {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--primary);
}

/* ===== Panel ===== */
.panel {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: none;
    padding: 28px;
    margin-bottom: 24px;
}

.panel-header {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
}

/* ===== Table ===== */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    text-align: right;
    padding: 12px;
    border-bottom: 2px solid #e0e0e0;
    color: var(--text-secondary);
    font-weight: 600;
}

.table td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.table tr:hover {
    background: #fafafa;
}

/* ===== Progress Bar ===== */
.progress-track {
    background: #e0e0e0;
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 10px;
    transition: width 0.5s ease;
    width: 0%;
}

/* ===== Spinner ===== */
.spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 24px;
    border: 4px solid #e0e0e0;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-inline {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid #e0e0e0;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state .empty-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* ===== Alert ===== */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background: #e8f5e9;
    border-right: 4px solid var(--color-success);
    color: #2e7d32;
}

.alert-danger {
    background: #ffebee;
    border-right: 4px solid var(--color-danger);
    color: #c62828;
}

.alert-warning {
    background: #fff3e0;
    border-right: 4px solid var(--color-warning);
    color: #e65100;
}

.alert-info {
    background: #e3f2fd;
    border-right: 4px solid var(--color-info);
    color: #1565c0;
}

/* ===== Search Card (dashboard list items) ===== */
.search-list-item {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    border: none;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.search-list-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.search-list-item .search-query {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.search-list-item .search-meta {
    color: var(--text-secondary);
    font-size: 0.85rem;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

/* ===== Back Link ===== */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 16px;
    transition: var(--transition);
}
.back-link:hover { color: var(--primary); }

/* ===== Info Box ===== */
.info-box {
    padding: 16px 20px;
    background: #e3f2fd;
    border-right: 4px solid var(--color-info);
    border-radius: var(--radius-lg);
}

.info-box h3 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: #1565c0;
}

.info-box p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ===== Cookie Section ===== */
.cookie-section {
    background: var(--bg-card);
    border: none;
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
}

.cookie-section h3 {
    margin-bottom: 12px;
    font-size: 1rem;
    color: var(--text-secondary);
}

.cookie-status {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.cookie-ok {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.cookie-missing {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

/* ===== Profile Cards ===== */
.profile-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 24px;
    border: none;
    margin-bottom: 16px;
    transition: var(--transition);
    animation: slideIn 0.4s ease;
}

.profile-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.profile-card.has-phone {
    border-right: 4px solid var(--color-success);
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
}

.profile-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #e0e0e0;
    flex-shrink: 0;
}

.profile-avatar-placeholder {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid #e0e0e0;
    background: var(--primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    flex-shrink: 0;
}

.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.profile-stat {
    text-align: center;
    background: #ffffff;
    border-radius: var(--radius-sm);
    padding: 8px;
}

.profile-stat .num { font-weight: 700; font-size: 1rem; color: var(--text-primary); }
.profile-stat .label { font-size: 0.7rem; color: var(--text-secondary); }

.profile-bio {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 8px 0;
    line-height: 1.6;
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 12px;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ===== Contact Badges ===== */
.contact-info {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.contact-badge {
    padding: 4px 14px;
    border-radius: var(--radius-pill);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.badge-phone { background: #e8f5e9; color: #2e7d32; }
.badge-email { background: #e3f2fd; color: #1565c0; }
.badge-website { background: #ede7f6; color: #4527a0; }
.badge-verified { background: #e8f5e9; color: #2e7d32; }

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

    .page-header-actions {
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-floating {
        position: static;
        margin-bottom: 10px;
        justify-content: center;
        flex-wrap: wrap;
    }

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

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

    .glass-card { padding: 20px; }
    .panel { padding: 20px; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
}
