* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

/* Layout principale con banner laterali */
.main-wrapper {
    display: flex;
    max-width: 1600px;
    margin: 0 auto;
    gap: 20px;
}

.ad-banner {
    width: 160px;
    position: sticky;
    top: 20px;
    height: fit-content;
}

.ad-banner.left {
    order: 1;
}

.ad-banner.right {
    order: 3;
}

.ad-space {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 20px;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 0.9em;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.container {
    flex: 1;
    order: 2;
    max-width: 1200px;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 50px;
    padding: 40px 20px;
}

header h1 {
    font-size: 3em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

header p {
    font-size: 1.2em;
    opacity: 0.9;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    padding: 20px;
}

.tool-card {
    background: white;
    border-radius: 15px;
    padding: 35px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    color: #333;
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.tool-card:hover::before {
    transform: scaleX(1);
}

.tool-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

.tool-card.coming-soon {
    opacity: 0.5;
    cursor: default;
}

.tool-card.coming-soon:hover {
    transform: none;
}

.tool-icon {
    font-size: 3.5em;
    margin-bottom: 20px;
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.1));
}

.tool-card h2 {
    font-size: 1.5em;
    margin-bottom: 12px;
    color: #667eea;
}

.tool-card p {
    font-size: 1em;
    color: #666;
    line-height: 1.6;
}

.tool-card .badge {
    display: inline-block;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75em;
    margin-top: 10px;
    font-weight: 600;
}

footer {
    text-align: center;
    color: white;
    margin-top: 60px;
    padding: 20px;
    opacity: 0.8;
}

/* Stili per la pagina del tool */
.tool-page {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 900px;
    margin: 0 auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.back-button {
    display: inline-block;
    margin-bottom: 30px;
    padding: 10px 20px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.3s ease, transform 0.2s ease;
    font-weight: 600;
}

.back-button:hover {
    background: #764ba2;
    transform: translateX(-5px);
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 1.05em;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

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

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.calculate-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.2em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
}

.calculate-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.calculate-btn:active {
    transform: scale(0.98);
}

.result {
    margin-top: 30px;
    padding: 30px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    border-radius: 12px;
    border: 2px solid rgba(102, 126, 234, 0.2);
    display: none;
}

.result.show {
    display: block;
    animation: slideIn 0.3s ease;
}

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

.result h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.5em;
}

.result p {
    font-size: 1.1em;
    line-height: 1.8;
    color: #333;
    margin-bottom: 10px;
}

.result .highlight {
    font-size: 2.2em;
    font-weight: bold;
    color: #764ba2;
    display: block;
    margin: 15px 0;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.result-item {
    background: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.result-item .label {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 8px;
}

.result-item .value {
    font-size: 1.5em;
    font-weight: bold;
    color: #667eea;
}

/* Stili per lista risorse esterne */
.resource-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    text-decoration: none;
    color: #333;
    display: block;
}

.resource-card:hover {
    border-color: #667eea;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.2);
    transform: translateX(10px);
}

.resource-card h3 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.4em;
}

.resource-card p {
    color: #666;
    margin-bottom: 10px;
    line-height: 1.6;
}

.resource-card .url {
    color: #764ba2;
    font-size: 0.9em;
    font-weight: 600;
}

.resource-category {
    margin-bottom: 40px;
}

.resource-category h2 {
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid #667eea;
}

/* Responsive */
@media (max-width: 1200px) {
    .ad-banner {
        display: none;
    }
    
    .main-wrapper {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
        padding: 10px;
    }
    
    .tool-page {
        padding: 25px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}
