/**
 * FOTOKLIK - CSS Variables & Base Styles
 * 
 * ============================================
 * COLORI UFFICIALI AGGIORNATI:
 * VIOLA: #994fa8
 * GIALLO: #d89b12
 * ============================================
 */

/* ============================================
   VARIABILI COLORE - COLORI UFFICIALI FOTOKLIK
   ============================================ */
:root {
    /* Colori principali - VIOLA e GIALLO ufficiali */
    --color-primary: #994fa8;
    /* Viola - Colore principale */
    --color-primary-hover: #a966b8;
    /* Viola chiaro - Hover */
    --color-primary-dim: #7a3f86;
    /* Viola scuro */
    
    /* Colore secondario - GIALLO */
    --color-secondary: #d89b12;
    /* Giallo - Colore accento */
    --color-secondary-hover: #e5ab2a;
    /* Giallo chiaro - Hover */
    --color-secondary-dim: #b8840f;
    /* Giallo scuro */

    /* Sfondi */
    --color-bg-app: #F5F5F7;
    --color-bg-card: #FFFFFF;
    --color-bg-card-hover: #F5F5F7;
    --color-bg-input: rgba(0, 0, 0, 0.04);

    /* Testi */
    --color-text-main: #1D1D1F;
    --color-text-muted: #6E6E73;
    --color-text-dark: #1D1D1F;

    /* Bordi */
    --color-border: #D2D2D7;
    --color-border-light: rgba(0, 0, 0, 0.08);
    --color-border-active: rgba(153, 79, 168, 0.4);

    /* Stati */
    --color-success: #34C759;
    --color-error: #FF3B30;
    --color-warning: #d89b12;
    --color-info: #007AFF;

    /* Shadows - leggeri stile Apple */
    --shadow-glow: 0 4px 20px rgba(153, 79, 168, 0.15);
    --shadow-card: 0 2px 20px rgba(0, 0, 0, 0.08);
    --shadow-button: 0 4px 12px rgba(153, 79, 168, 0.25);

    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-blur: 20px;

    /* Typography */
    --font-heading: 'Playfair Display', Georgia, serif;
    --font-body: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
    --transition-slow: 500ms ease;
}

/* Photo Gallery */
.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: var(--spacing-md);
}

.photo-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color var(--transition-normal);
}

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

.photo-item.selected {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-glow);
}

.photo-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--spacing-xs) var(--spacing-sm);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.photo-item:hover .photo-overlay {
    opacity: 1;
}

/* ============================================
   RESET & BASE
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg-app);
    color: var(--color-text-main);
    line-height: 1.6;
    min-height: 100vh;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.2;
    color: var(--color-text-main);
}

h1 {
    font-size: 2.5rem;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 2rem;
    letter-spacing: -0.01em;
}

h3 {
    font-family: var(--font-body);
    font-size: 1.25rem;
    font-weight: 600;
}

p {
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-md);
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

/* ============================================
   LAYOUT
   ============================================ */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

.container-sm {
    max-width: 640px;
}

.container-md {
    max-width: 768px;
}

.container-lg {
    max-width: 1024px;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
    transition: border-color var(--transition-normal);
}

.card:hover {
    border-color: var(--color-border-active);
}

.card-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
}

.card-metric {
    position: relative;
    overflow: hidden;
}

.card-metric::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.card-metric:hover::before {
    opacity: 1;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-lg);
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-lg);
    border: none;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
    box-shadow: var(--shadow-button);
}

.btn-primary:hover {
    background: var(--color-primary-hover);
    transform: translateY(-2px);
    color: #fff;
}

.btn-secondary {
    background: transparent;
    color: var(--color-text-main);
    border: 1px solid var(--color-border-light);
}

.btn-secondary:hover {
    border-color: var(--color-primary);
    background: rgba(153, 79, 168, 0.1);
}

/* Bottone giallo/accento */
.btn-accent {
    background: var(--color-secondary);
    color: #000;
    box-shadow: 0 0 15px rgba(216, 155, 18, 0.4);
}

.btn-accent:hover {
    background: var(--color-secondary-hover);
    transform: translateY(-2px);
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-muted);
    padding: var(--spacing-xs) var(--spacing-sm);
}

.btn-ghost:hover {
    color: var(--color-text-main);
}

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

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

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

.btn-lg {
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: 1rem;
}

.btn-sm {
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: 0.75rem;
}

.btn-block {
    width: 100%;
}

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

/* ============================================
   FORMS
   ============================================ */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-sm);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--spacing-md);
    background: var(--color-bg-input);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    color: var(--color-text-main);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(153, 79, 168, 0.1);
}

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

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

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23888888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--spacing-md) center;
    background-size: 1rem;
    padding-right: 3rem;
}

.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    cursor: pointer;
}

.form-checkbox input {
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.1rem;
    accent-color: var(--color-primary);
}

.form-error {
    font-size: 0.875rem;
    color: var(--color-error);
    margin-top: var(--spacing-xs);
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--color-success);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--color-error);
}

.alert-warning {
    background: rgba(216, 155, 18, 0.1);
    border: 1px solid rgba(216, 155, 18, 0.3);
    color: var(--color-secondary);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--color-info);
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-full);
}

.badge-gold,
.badge-primary {
    background: rgba(153, 79, 168, 0.2);
    color: var(--color-primary);
}

.badge-accent {
    background: rgba(216, 155, 18, 0.2);
    color: var(--color-secondary);
}

.badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--color-success);
}

.badge-error {
    background: rgba(239, 68, 68, 0.2);
    color: var(--color-error);
}

.badge-warning {
    background: rgba(216, 155, 18, 0.2);
    color: var(--color-secondary);
}

.badge-muted {
    background: rgba(136, 136, 136, 0.2);
    color: var(--color-text-muted);
}

/* ============================================
   TEXT UTILITIES - Aggiornati per nuovi colori
   ============================================ */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-gold,
.text-primary {
    color: var(--color-primary);
}

.text-accent,
.text-secondary {
    color: var(--color-secondary);
}

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

.text-success {
    color: var(--color-success);
}

.text-error {
    color: var(--color-error);
}

.text-sm {
    font-size: 0.875rem;
}

.text-xs {
    font-size: 0.75rem;
}

.text-lg {
    font-size: 1.125rem;
}

.text-xl {
    font-size: 1.25rem;
}

.text-2xl {
    font-size: 1.5rem;
}

.text-3xl {
    font-size: 2rem;
}

.text-4xl {
    font-size: 2.5rem;
}

.font-heading {
    font-family: var(--font-heading);
}

.font-bold {
    font-weight: 700;
}

.font-semibold {
    font-weight: 600;
}

.font-normal {
    font-weight: 400;
}

.font-light {
    font-weight: 300;
}

.uppercase {
    text-transform: uppercase;
}

.tracking-wide {
    letter-spacing: 0.05em;
}

.tracking-wider {
    letter-spacing: 0.1em;
}

/* Spacing utilities */
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }
.mb-5 { margin-bottom: var(--spacing-xl); }
.mb-6 { margin-bottom: var(--spacing-2xl); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }
.mt-5 { margin-top: var(--spacing-xl); }

.p-0 { padding: 0; }
.p-1 { padding: var(--spacing-xs); }
.p-2 { padding: var(--spacing-sm); }
.p-3 { padding: var(--spacing-md); }
.p-4 { padding: var(--spacing-lg); }
.p-5 { padding: var(--spacing-xl); }

/* Flex utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--spacing-xs); }
.gap-2 { gap: var(--spacing-sm); }
.gap-3 { gap: var(--spacing-md); }
.gap-4 { gap: var(--spacing-lg); }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }

/* Grid utilities */
.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Display utilities */
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }

/* Size utilities */
.w-full { width: 100%; }
.h-full { height: 100%; }

/* Border radius */
.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

/* Shadows */
.shadow { box-shadow: var(--shadow-card); }
.shadow-glow { box-shadow: var(--shadow-glow); }

/* Misc */
.overflow-hidden { overflow: hidden; }
.relative { position: relative; }
.absolute { position: absolute; }
.cursor-pointer { cursor: pointer; }
.select-none { user-select: none; }

/* ============================================
   TABLES
   ============================================ */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
}

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

th,
td {
    padding: var(--spacing-md);
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

th {
    background: var(--color-bg-card);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
}

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

.animate-fadeIn { animation: fadeIn 0.3s ease; }
.animate-slideUp { animation: slideUp 0.4s ease forwards; }
.animate-pulse { animation: pulse 2s infinite; }
.animate-spin { animation: spin 1s linear infinite; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    .container { padding: 0 var(--spacing-md); }
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 { grid-template-columns: 1fr; }
    .hide-mobile { display: none; }
}

@media (min-width: 769px) {
    .hide-desktop { display: none; }
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg-card);
}

::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-muted);
}
