/* Color Variables */
:root {
    --primary-color: #d4462a;
    --secondary-color: #f4a261;
    --accent-color: #e76f51;
    --success-color: #2a9d8f;
    --warning-color: #e9c46a;
    --danger-color: #e63946;
    --dark-color: #264653;
    --light-color: #f8f9fa;
    --pink-color: #E1306C;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    --gradient-secondary: linear-gradient(135deg, var(--secondary-color), var(--warning-color));
}

/* Bootstrap Color Overrides */
.bg-primary {
    background: var(--gradient-primary) !important;
}

.text-primary {
    color: var(--primary-color) !important;
}

.btn-primary {
    background: var(--gradient-primary);
    border: none;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 70, 42, 0.3);
}

.btn-accent {
    background: var(--accent-color);
    border: none;
    color: white;
    transition: all 0.3s ease;
}

.btn-accent:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 111, 81, 0.3);
}

.text-accent {
    color: var(--accent-color) !important;
}

.text-pink {
    color: var(--pink-color) !important;
}

.bg-accent {
    background-color: var(--accent-color) !important;
}

.bg-pink {
    background-color: var(--pink-color) !important;
}

.bg-gradient {
    background: var(--gradient-primary) !important;
}

.bg-gradient-success {
    background: linear-gradient(135deg, var(--success-color), #20c997) !important;
}

/* Typography */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
}

.fw-bold {
    font-weight: 700 !important;
}

.fw-semibold {
    font-weight: 600 !important;
}

/* Hero Section */
.hero-section {
    background: var(--gradient-primary);
    min-height: 50vh;
    display: flex;
    align-items: center;
    padding: 3rem 0;
}

.hero-image {
    /* Rimossa animazione per evitare interferenze con il layout */
}

.hero-image img {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 3px solid rgba(255, 255, 255, 0.2);
}

.hero-image img:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Hero images grid hover effects */
.hero-images img {
    transition: all 0.3s ease;
}

.hero-images img:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 30px rgba(0,0,0,0.2) !important;
}

.hero-images .text-center {
    transition: all 0.3s ease;
}

.hero-images .text-center:hover {
    transform: translateY(-8px);
}

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

/* Cards */
.card {
    border-radius: 15px;
    transition: all 0.3s ease;
}

.feature-card:hover,
.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.feature-icon,
.tool-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* Forms */
.form-control,
.form-select {
    border-radius: 10px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(212, 70, 42, 0.25);
}

.form-control-lg {
    padding: 0.75rem 1rem;
    font-size: 1.1rem;
}

/* Input Groups */
.input-group-text {
    background-color: var(--light-color);
    border: 2px solid #e9ecef;
    border-right: none;
    color: var(--primary-color);
}

.input-group .form-control {
    border-left: none;
}

.input-group:focus-within .input-group-text {
    border-color: var(--primary-color);
    background-color: rgba(212, 70, 42, 0.1);
}

/* Buttons */
.btn {
    border-radius: 10px;
    font-weight: 600;
    padding: 0.6rem 1.5rem;
    transition: all 0.3s ease;
}

.btn-lg {
    padding: 0.8rem 2rem;
    font-size: 1.1rem;
}

.btn:hover {
    transform: translateY(-2px);
}

/* Alerts */
.alert {
    border-radius: 12px;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.alert-info {
    background-color: rgba(42, 157, 143, 0.1);
    color: var(--success-color);
    border-left: 4px solid var(--success-color);
}

.alert-success {
    background-color: rgba(42, 157, 143, 0.1);
    color: var(--success-color);
}

.alert-danger {
    background-color: rgba(230, 57, 70, 0.1);
    color: var(--danger-color);
}

/* Badges */
.badge {
    font-size: 0.75rem;
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
}

/* Progress */
.progress {
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    border-radius: 10px;
}

/* Navigation */
.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
}

.nav-link {
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-link:hover {
    transform: translateY(-1px);
}

/* Footer */
footer {
    background: var(--dark-color) !important;
}

/* Custom Utilities */
.shadow-custom {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Responsive Images */
.card-img-top {
    transition: transform 0.3s ease;
    height: 250px;
    object-fit: cover;
}

.card-img-top.responsive-img {
    object-fit: cover;
    object-position: center;
}

.card:hover .card-img-top {
    transform: scale(1.02);
}

/* Responsive homepage images */
@media (max-width: 576px) {
    .card-img-top {
        height: 180px !important;
    }
}

@media (max-width: 768px) {
    .card-img-top {
        height: 200px !important;
    }
}

@media (min-width: 992px) {
    .card-img-top {
        height: 260px !important;
    }
}

@media (min-width: 1200px) {
    .card-img-top {
        height: 280px !important;
    }
}

@media (min-width: 1400px) {
    .card-img-top {
        height: 300px !important;
    }
}

.rounded-custom {
    border-radius: 15px;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section {
        min-height: 50vh;
        text-align: center;
    }
    
    .display-4 {
        font-size: 2rem;
    }
    
    .feature-card,
    .tool-card {
        margin-bottom: 1rem;
    }
    
    .btn-lg {
        padding: 0.7rem 1.5rem;
        font-size: 1rem;
    }
}

/* Copy button animations */
.btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Pre-formatted text styling */
pre {
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Details/Summary styling */
details summary {
    cursor: pointer;
    user-select: none;
    outline: none;
}

details summary::-webkit-details-marker {
    display: none;
}

details[open] summary {
    margin-bottom: 0.5rem;
}

/* Custom scrollbar for code blocks */
.bg-dark pre::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.bg-dark pre::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.bg-dark pre::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.bg-dark pre::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Loading states */
.btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Hover effects for interactive elements */
.card-header {
    border-radius: 15px 15px 0 0 !important;
}

.list-group-item:first-child {
    border-radius: 15px 15px 0 0;
}

.list-group-item:last-child {
    border-radius: 0 0 15px 15px;
}

/* Custom spacing */
.gap-3 {
    gap: 1rem !important;
}

/* Icon styling */
.fa, .fas, .fab {
    line-height: inherit;
}

/* Modal enhancements */
.modal-content {
    border-radius: 15px;
    border: none;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.modal-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 15px 15px 0 0;
}

.modal-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0 0 15px 15px;
}

/* Homepage Tools Centering Optimization */
.feature-icon {
    transition: all 0.3s ease;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100px;
    margin: 0 auto;
}

.feature-icon:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.feature-icon i {
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 8px;
}

.feature-icon p {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    margin: 0;
    text-align: center;
    line-height: 1.2;
}

/* Perfect centering for all devices */
@media (max-width: 575.98px) {
    /* Extra small devices (smartphones in portrait) */
    .feature-icon {
        max-width: 90px;
        padding: 12px 8px !important;
        min-height: 85px;
    }
    
    .feature-icon i {
        font-size: 1.5rem !important;
    }
    
    .feature-icon p {
        font-size: 0.7rem !important;
        line-height: 1.1;
    }
}

@media (min-width: 576px) and (max-width: 767.98px) {
    /* Small devices (smartphones in landscape, small tablets) */
    .feature-icon {
        max-width: 110px;
        min-height: 95px;
    }
    
    .feature-icon i {
        font-size: 1.8rem !important;
    }
    
    .feature-icon p {
        font-size: 0.8rem !important;
    }
}

@media (min-width: 768px) {
    /* Medium devices and up (tablets, desktops) */
    .feature-icon {
        max-width: 130px;
        min-height: 110px;
    }
    
    .feature-icon i {
        font-size: 2rem !important;
    }
    
    .feature-icon p {
        font-size: 0.85rem !important;
    }
}

/* Footer Logo Styling */
.footer-logo {
    transition: all 0.3s ease;
    border-radius: 8px;
    filter: brightness(0.9);
}

.footer-logo:hover {
    opacity: 1 !important;
    transform: scale(1.05);
    filter: brightness(1);
}

/* Responsive footer logo */
@media (max-width: 767.98px) {
    .footer-logo {
        height: 32px !important;
        margin: 0 auto;
    }
    
    .col-md-6.text-md-end {
        text-align: center !important;
        margin-top: 1rem;
    }
    
    .d-flex.flex-column.align-items-md-end {
        align-items: center !important;
    }
}
