/* Modern Currency Collection Manager - Enhanced Design */

/* CSS Variables for Theme */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    --info-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gold-gradient: linear-gradient(135deg, #f7971e 0%, #ffd200 100%);
    
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #43e97b;
    --danger-color: #f5576c;
    --warning-color: #ffa502;
    --info-color: #4facfe;
    
    --bg-primary: #f8f9ff;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e8ecff;
    --text-primary: #1a1d29;
    --text-secondary: #6c727f;
    --text-tertiary: #9ca3af;
    --border-color: rgba(102, 126, 234, 0.1);
    --shadow-sm: 0 2px 8px rgba(102, 126, 234, 0.08);
    --shadow: 0 4px 16px rgba(102, 126, 234, 0.12);
    --shadow-lg: 0 12px 40px rgba(102, 126, 234, 0.18);
    --shadow-xl: 0 20px 60px rgba(102, 126, 234, 0.25);
    
    --navbar-height: 80px;
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

[data-theme="dark"] {
    --bg-primary: #0f1117;
    --bg-secondary: #1a1d29;
    --bg-tertiary: #252936;
    --text-primary: #ffffff;
    --text-secondary: #b8bcc8;
    --text-tertiary: #6c727f;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.6);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: var(--transition);
    overflow-x: hidden;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(245, 87, 108, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 40% 90%, rgba(67, 233, 123, 0.03) 0%, transparent 50%);
    z-index: -1;
    animation: backgroundShift 20s ease infinite;
}

@keyframes backgroundShift {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-gradient);
    border-radius: 10px;
    transition: var(--transition);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-gradient);
}

/* Navigation - Glassmorphism */
.navbar {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    height: var(--navbar-height);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    animation: slideDown 0.5s ease;
}

[data-theme="dark"] .navbar {
    background: rgba(26, 29, 41, 0.8);
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.75rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    cursor: pointer;
    transition: var(--transition);
}

.nav-brand:hover {
    transform: scale(1.05);
    filter: brightness(1.2);
}

.nav-brand i {
    font-size: 2rem;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: coinFlip 3s ease-in-out infinite;
}

@keyframes coinFlip {
    0%, 100% { transform: rotateY(0deg); }
    50% { transform: rotateY(180deg); }
}

.nav-menu {
    display: flex;
    gap: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.875rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 16px;
    transition: var(--transition);
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--primary-gradient);
    opacity: 0;
    transition: var(--transition);
    z-index: -1;
}

.nav-link:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.nav-link:hover::before {
    opacity: 1;
}

.nav-link.active {
    color: white;
    background: var(--primary-gradient);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.nav-link i {
    font-size: 1.125rem;
    transition: var(--transition);
}

.nav-link:hover i,
.nav-link.active i {
    transform: scale(1.2) rotate(5deg);
}

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

.btn-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.btn-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: var(--primary-gradient);
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.btn-icon:hover {
    transform: scale(1.1) rotate(10deg);
    box-shadow: var(--shadow);
}

.btn-icon:hover::before {
    width: 100%;
    height: 100%;
}

.btn-icon i {
    position: relative;
    z-index: 1;
    transition: var(--transition);
}

.btn-icon:hover i {
    color: white;
}

.btn-primary {
    padding: 1rem 2rem;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 16px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: var(--transition);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: var(--shadow-xl);
}

.btn-primary:active {
    transform: translateY(-1px) scale(0.98);
}

.btn-secondary {
    padding: 0.875rem 1.75rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* Main Content */
.main-content {
    margin-top: calc(var(--navbar-height) + 2rem);
    padding: 0 2rem 4rem;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.page {
    display: none;
}

.page.active {
    display: block;
    animation: fadeInUp 0.5s var(--bounce);
}

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

.page-header {
    margin-bottom: 3rem;
    text-align: center;
}

.page-header h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 900;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { filter: hue-rotate(0deg); }
    50% { filter: hue-rotate(10deg); }
}

.page-header p {
    color: var(--text-secondary);
    font-size: 1.25rem;
    font-weight: 500;
}

.page-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 1rem 1.5rem;
    flex: 1;
    min-width: 300px;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.search-box:focus-within {
    border-color: var(--primary-color);
    box-shadow: var(--shadow), 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.search-box i {
    color: var(--text-secondary);
    font-size: 1.25rem;
    transition: var(--transition);
}

.search-box:focus-within i {
    color: var(--primary-color);
    transform: scale(1.2);
}

.search-box input {
    border: none;
    background: none;
    outline: none;
    color: var(--text-primary);
    font-size: 1rem;
    width: 100%;
    font-weight: 500;
}

.filter-select {
    padding: 1rem 1.5rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.filter-select:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* Stats Grid - Animated Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--bg-secondary);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: var(--transition);
}

.stat-card:hover::before {
    opacity: 1;
    animation: shimmer 1.5s ease infinite;
}

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

.stat-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-xl);
    border-color: transparent;
}

.stat-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.stat-icon::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(45deg);
    transition: var(--transition);
}

.stat-card:hover .stat-icon::after {
    animation: shine 0.8s ease;
}

@keyframes shine {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: countUp 1s ease;
}

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

.stat-label {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.dashboard-card {
    background: var(--bg-secondary);
    border-radius: 24px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

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

.card-header {
    padding: 2rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, transparent 100%);
}

.card-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.card-body {
    padding: 2rem;
}

.recent-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.recent-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.25rem;
    background: var(--bg-primary);
    border-radius: 16px;
    transition: var(--transition);
    cursor: pointer;
    border: 1px solid var(--border-color);
}

.recent-item:hover {
    background: var(--bg-tertiary);
    transform: translateX(8px);
    box-shadow: var(--shadow);
    border-color: var(--primary-color);
}

.recent-item-img {
    width: 70px;
    height: 70px;
    border-radius: 12px;
    object-fit: cover;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 2rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.recent-item:hover .recent-item-img {
    transform: scale(1.1) rotate(5deg);
}

.recent-item-content {
    flex: 1;
}

.recent-item-title {
    font-weight: 700;
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.recent-item-meta {
    color: var(--text-secondary);
    font-size: 0.938rem;
    font-weight: 500;
}

/* Collection Grid - 3D Flip Cards */
.collection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.collection-item {
    perspective: 1000px;
    height: 480px;
}

.collection-item-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.collection-item:hover .collection-item-inner {
    transform: rotateY(180deg);
}

.collection-item-front,
.collection-item-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.collection-item-front {
    background: var(--bg-secondary);
}

.collection-item-back {
    background: var(--primary-gradient);
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    color: white;
}

.collection-item:hover .collection-item-front,
.collection-item:hover .collection-item-back {
    box-shadow: var(--shadow-xl);
}

.collection-item-image {
    width: 100%;
    height: 240px;
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-primary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    font-size: 4rem;
    position: relative;
    overflow: hidden;
}

.collection-item-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: imageShine 3s ease infinite;
}

@keyframes imageShine {
    0%, 100% { left: -100%; }
    50% { left: 100%; }
}

.collection-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.collection-item:hover .collection-item-image img {
    transform: scale(1.1);
}

.collection-item-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    color: var(--primary-color);
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 700;
    box-shadow: var(--shadow);
    animation: pulse 2s ease infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.collection-item-content {
    padding: 1.5rem;
}

.collection-item-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.collection-item-title {
    font-weight: 800;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.collection-item-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
}

.collection-item-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-icon-sm {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--bg-primary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.btn-icon-sm:hover {
    background: var(--primary-gradient);
    color: white;
    transform: scale(1.2) rotate(10deg);
    box-shadow: var(--shadow);
}

.btn-icon-sm.danger:hover {
    background: var(--secondary-gradient);
}

.collection-item-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-label {
    color: var(--text-secondary);
    font-size: 0.813rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}

/* Back of card styling */
.collection-item-back h3 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-align: center;
}

.collection-item-back-details {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.back-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.back-detail-label {
    font-weight: 600;
    opacity: 0.9;
}

.back-detail-value {
    font-weight: 700;
}

/* Database Table - Modern Design */
.database-table {
    background: var(--bg-secondary);
    border-radius: 24px;
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

th {
    padding: 1.5rem;
    text-align: left;
    font-weight: 700;
    font-size: 0.938rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
}

td {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 500;
}

tr {
    transition: var(--transition);
}

tr:hover {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.05) 0%, transparent 100%);
    transform: scale(1.01);
}

.status-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}

.status-current {
    background: var(--success-gradient);
    color: white;
}

.status-historical {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
    color: white;
}

.table-actions {
    display: flex;
    gap: 0.5rem;
}

/* Gallery Grid - Masonry Style */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.gallery-item {
    position: relative;
    aspect-ratio: 4/3;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.gallery-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.3) 0%, rgba(245, 87, 108, 0.3) 100%);
    opacity: 0;
    transition: var(--transition);
    z-index: 1;
}

.gallery-item:hover::before {
    opacity: 1;
}

.gallery-item:hover {
    transform: scale(1.05) rotate(2deg);
    box-shadow: var(--shadow-xl);
    z-index: 10;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.7), transparent);
    padding: 1.5rem;
    color: white;
    opacity: 0;
    transform: translateY(20px);
    transition: var(--transition);
    z-index: 2;
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
    transform: translateY(0);
}

.gallery-item-overlay strong {
    display: block;
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

/* Modal - Enhanced Design */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px) saturate(150%);
    -webkit-backdrop-filter: blur(10px) saturate(150%);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 32px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: modalSlideUp 0.4s var(--bounce);
    border: 1px solid var(--border-color);
}

.modal-content.large {
    max-width: 900px;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, transparent 100%);
}

.modal-header h2 {
    font-size: 2rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-close {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.modal-close:hover {
    background: var(--secondary-gradient);
    color: white;
    transform: scale(1.1) rotate(90deg);
    box-shadow: var(--shadow);
}

.modal-body {
    padding: 2rem;
}

/* Form Styles - Modern Design */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.938rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control {
    padding: 1rem 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: var(--shadow), 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.form-control:hover {
    border-color: var(--primary-color);
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

.form-checkbox {
    width: 20px;
    height: 20px;
    margin-right: 0.75rem;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

/* Photo Upload - Enhanced Design */
.photo-upload-area {
    border: 3px dashed var(--border-color);
    border-radius: 24px;
    padding: 3rem;
    text-align: center;
    transition: var(--transition);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.02) 0%, rgba(245, 87, 108, 0.02) 100%);
    position: relative;
    overflow: hidden;
}

.photo-upload-area::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.1) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    transition: var(--transition);
}

.photo-upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.05);
    transform: scale(1.02);
}

.photo-upload-area.dragover::before {
    width: 500px;
    height: 500px;
    animation: ripple 1s ease infinite;
}

@keyframes ripple {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(0); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}

.upload-placeholder {
    cursor: pointer;
    position: relative;
    z-index: 1;
}

.upload-placeholder i {
    font-size: 4rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    display: block;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.upload-placeholder p {
    color: var(--text-secondary);
    font-size: 1.125rem;
    font-weight: 600;
}

.photo-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.photo-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 2px solid var(--border-color);
}

.photo-preview-item:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.photo-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-remove {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--secondary-gradient);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.photo-preview-item:hover .photo-remove {
    opacity: 1;
    transform: scale(1.1);
}

.photo-remove:hover {
    transform: scale(1.2) rotate(90deg);
}

/* Photo Viewer - Enhanced */
.photo-viewer {
    max-width: 95vw;
    max-height: 95vh;
    background: rgba(0, 0, 0, 0.98);
    position: relative;
    padding: 0;
    border-radius: 24px;
    overflow: hidden;
}

.photo-viewer img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    display: block;
    margin: auto;
}

.photo-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.photo-nav:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.photo-nav.prev {
    left: 2rem;
}

.photo-nav.next {
    right: 2rem;
}

.photo-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.7), transparent);
    padding: 3rem;
    color: white;
    backdrop-filter: blur(10px);
}

.photo-info strong {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 0.5rem;
}

/* Empty State - Attractive Design */
.empty-state {
    text-align: center;
    padding: 5rem 2rem;
    animation: fadeInUp 0.5s ease;
}

.empty-state i {
    font-size: 6rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 2rem;
    display: block;
    animation: float 3s ease-in-out infinite;
}

.empty-state h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
    font-weight: 800;
    color: var(--text-primary);
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 1.125rem;
    margin-bottom: 2rem;
    font-weight: 500;
}

/* Loading Spinner - Beautiful Animation */
.spinner {
    width: 60px;
    height: 60px;
    margin: 4rem auto;
    position: relative;
}

.spinner::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid transparent;
    border-top-color: var(--primary-color);
    border-right-color: var(--secondary-color);
    animation: spin 1s linear infinite;
}

.spinner::after {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border-radius: 50%;
    border: 4px solid transparent;
    border-bottom-color: var(--success-color);
    border-left-color: var(--info-color);
    animation: spin 1.5s linear infinite reverse;
}

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

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: 8px;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
    
    .nav-container {
        padding: 0 1rem;
    }
    
    .main-content {
        padding: 0 1rem 3rem;
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .collection-grid {
        grid-template-columns: 1fr;
    }
    
    .collection-item {
        height: auto;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .page-actions {
        flex-direction: column;
    }
    
    .search-box {
        width: 100%;
        min-width: 0;
    }
}

/* Utilities */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* Success/Error Messages with Animation */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1.25rem 2rem;
    background: var(--success-gradient);
    color: white;
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    font-weight: 600;
    animation: slideInRight 0.4s var(--bounce);
    z-index: 3000;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.error {
    background: var(--secondary-gradient);
}

/* Print Styles */
@media print {
    .navbar,
    .nav-actions,
    .page-actions,
    .btn-icon-sm,
    .modal {
        display: none !important;
    }
    
    .main-content {
        margin-top: 0;
    }
    
    .collection-item:hover .collection-item-inner {
        transform: none;
    }
}
