/* Style.css - Stili Unificati */

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --admin-color: #1f2937;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --dark-color: #1f2937;
    --light-color: #f9fafb;
    --sidebar-width: 280px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-color);
}

/* ============================================
   NOTIFICHE PERSONALIZZATE
   ============================================ */
.notification {
    padding: 16px 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    border-left: 5px solid;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.notification-success {
    background-color: #ecfdf5;
    border-left-color: var(--success-color);
    color: #065f46;
}

.notification-danger {
    background-color: #fef2f2;
    border-left-color: var(--danger-color);
    color: #991b1b;
}

.notification-warning {
    background-color: #fffbeb;
    border-left-color: var(--warning-color);
    color: #92400e;
}

.notification-info {
    background-color: #eff6ff;
    border-left-color: var(--info-color);
    color: #1e40af;
}

.notification::before {
    content: '';
    font-size: 24px;
    line-height: 1;
}

.notification-success::before {
    content: '✅';
}

.notification-danger::before {
    content: '❌';
}

.notification-warning::before {
    content: '⚠️';
}

.notification-info::before {
    content: 'ℹ️';
}

.notification-close {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.6;
    padding: 0 8px;
    line-height: 1;
}

.notification-close:hover {
    opacity: 1;
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-page {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    max-width: 450px;
    width: 100%;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.logo-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

/* ============================================
   SIDEBAR LAYOUT
   ============================================ */
.wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
}

.sidebar {
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    background: var(--admin-color);
    color: #fff;
    transition: all 0.3s;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.sidebar.active {
    margin-left: calc(var(--sidebar-width) * -1);
}

.sidebar-header {
    padding: 20px;
    background: rgba(0,0,0,0.2);
}

.sidebar-header h3 {
    margin: 0;
    font-size: 24px;
}

.sidebar ul.components {
    flex: 1;
    padding: 20px 0;
}

.sidebar ul li {
    padding: 0;
}

.sidebar ul li a {
    padding: 12px 20px;
    font-size: 16px;
    display: block;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.3s;
}

.sidebar ul li a:hover,
.sidebar ul li a.active {
    color: #fff;
    background: var(--primary-color);
}

.sidebar ul li a .icon {
    margin-right: 10px;
    font-size: 18px;
}

.menu-section {
    padding: 20px 20px 10px;
    font-size: 12px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.4);
    font-weight: bold;
}

.sidebar-footer {
    padding: 20px;
    background: rgba(0,0,0,0.2);
    border-top: 1px solid rgba(255,255,255,0.1);
}

.user-info {
    margin-bottom: 10px;
}

/* ============================================
   CONTENT AREA
   ============================================ */
#content {
    width: 100%;
    min-height: 100vh;
    transition: all 0.3s;
}

.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

#sidebarCollapse {
    font-size: 20px;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    margin-bottom: 20px;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.stat-card {
    border-left: 4px solid var(--primary-color);
}

/* Configuratori */
.configuratore-card {
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.configuratore-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.2);
}

.configuratore-icon {
    font-size: 48px;
}

/* Quick Links */
.quick-link {
    text-decoration: none;
    color: inherit;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.quick-link:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.2);
    color: inherit;
}

.quick-link .icon {
    font-size: 48px;
    margin-bottom: 10px;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-lg {
    padding: 15px 30px;
    font-size: 18px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* ============================================
   TABLES
   ============================================ */
.table {
    background: white;
}

.table thead {
    background-color: #f8f9fa;
}

.table-hover tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.05);
}

/* ============================================
   FORMS
   ============================================ */
.form-control {
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    padding: 12px 16px;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 500;
}

/* ============================================
   DRAG & DROP
   ============================================ */
.draggable-item {
    cursor: move;
    transition: all 0.2s;
}

.draggable-item:hover {
    background-color: rgba(102, 126, 234, 0.05);
}

.dragging {
    opacity: 0.5;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    padding: 20px 0;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    margin-top: 40px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .sidebar {
        margin-left: calc(var(--sidebar-width) * -1);
    }
    
    .sidebar.active {
        margin-left: 0;
    }
    
    .login-card {
        padding: 30px 20px;
    }
}

/* Touch friendly for tablets */
@media (min-width: 768px) {
    .btn-lg {
        min-height: 60px;
    }
}
