@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #F5F7FA;
    color: #333333;
    line-height: 1.6;
    min-height: 100vh;
    font-weight: 400;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 24px;
}

/* Header Styles */
header {
    text-align: center;
    margin-bottom: 48px;
    padding: 32px 0;
    background: linear-gradient(135deg, #0A1F44 0%, #1a365d 100%);
    border-radius: 12px;
    color: white;
    box-shadow: 0 4px 20px rgba(10, 31, 68, 0.15);
}

header h1 {
    font-size: 2.75rem;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.025em;
}

header p {
    font-size: 1.125rem;
    font-weight: 400;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

.main-content {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 40px;
    min-height: 70vh;
    align-items: start;
}

/* Sidebar Styles */
.sidebar {
    background: white;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    border: 1px solid #E5E7EB;
    position: sticky;
    top: 24px;
}

.flag-controls h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 24px;
    color: #0A1F44;
    padding-bottom: 12px;
    border-bottom: 2px solid #E5E7EB;
}

.flag-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.flag-form input[type="text"],
.flag-form textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
    background: #FAFBFC;
}

.flag-form input[type="text"]:focus,
.flag-form textarea:focus {
    outline: none;
    border-color: #00B8A9;
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 184, 169, 0.1);
}

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

.weight-control {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
}

.weight-control label {
    font-weight: 500;
    font-size: 14px;
    color: #374151;
    min-width: 100px;
}

.weight-control input[type="range"] {
    flex: 1;
    height: 6px;
    background: #E5E7EB;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.weight-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #00B8A9;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}

.weight-control input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 184, 169, 0.3);
}

.weight-control input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #00B8A9;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.weight-control span {
    font-weight: 600;
    color: #00B8A9;
    font-size: 16px;
    min-width: 24px;
    text-align: center;
}

.button-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.btn {
    padding: 14px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: none;
    letter-spacing: 0;
    position: relative;
    overflow: hidden;
}

.btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover:before {
    left: 100%;
}

.btn-red {
    background: #E74C3C;
    color: white;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.25);
}

.btn-red:hover {
    background: #C0392B;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(231, 76, 60, 0.3);
}

.btn-green {
    background: #2ECC71;
    color: white;
    box-shadow: 0 2px 8px rgba(46, 204, 113, 0.25);
}

.btn-green:hover {
    background: #27AE60;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(46, 204, 113, 0.3);
}

.totals {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 2px solid #E5E7EB;
}

.totals h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: #0A1F44;
}

.total-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    margin-bottom: 8px;
    background: #FAFBFC;
    border-radius: 8px;
    font-weight: 500;
    border-left: 4px solid transparent;
}

.total-item.red {
    color: #E74C3C;
    border-left-color: #E74C3C;
}

.total-item.green {
    color: #2ECC71;
    border-left-color: #2ECC71;
}

.total-item span:last-child {
    font-weight: 700;
    font-size: 1.1rem;
}

/* Scale Area Styles */
.scale-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    background: white;
    border-radius: 16px;
    padding: 40px 40px 60px 40px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    border: 1px solid #E5E7EB;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-blend-mode: overlay;
    min-height: 400px;
}

.scale-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 16px;
    z-index: 0;
    pointer-events: none;
}

.scale-area > * {
    position: relative;
    z-index: 1;
}

.lady-justice-bg {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 120px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M50 15c-3 0-5 2-5 5v3h10v-3c0-3-2-5-5-5z" fill="rgba(10,31,68,0.08)"/><path d="M35 30h30l-3 25H38z" fill="rgba(10,31,68,0.08)"/><circle cx="25" cy="28" r="6" fill="none" stroke="rgba(10,31,68,0.08)" stroke-width="1.5"/><circle cx="75" cy="28" r="6" fill="none" stroke="rgba(10,31,68,0.08)" stroke-width="1.5"/><line x1="25" y1="28" x2="50" y2="32" stroke="rgba(10,31,68,0.08)" stroke-width="1.5"/><line x1="75" y1="28" x2="50" y2="32" stroke="rgba(10,31,68,0.08)" stroke-width="1.5"/></svg>') center/contain no-repeat;
    opacity: 0.4;
    z-index: 0;
}

.scale-container {
    position: relative;
    margin: 80px 0 40px;
    z-index: 1;
    min-height: 200px;
}

.scale-base {
    width: 24px;
    height: 100px;
    background: linear-gradient(180deg, #0A1F44 0%, #1a365d 100%);
    margin: 0 auto;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(10, 31, 68, 0.2);
    position: relative;
}

.scale-base:after {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 16px;
    background: #00B8A9;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 184, 169, 0.3);
}

.scale-beam {
    position: relative;
    width: 640px;
    height: 12px;
    background: linear-gradient(90deg, #0A1F44 0%, #1a365d 50%, #0A1F44 100%);
    margin: -6px auto 0;
    border-radius: 6px;
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), filter 0.3s ease;
    transform-origin: center;
    box-shadow: 0 2px 12px rgba(10, 31, 68, 0.15);
}

.scale-pan {
    position: absolute;
    top: 12px;
    width: 200px;
    min-height: 120px;
    max-height: none;
    background: white;
    border: 3px solid #0A1F44;
    border-radius: 100px 100px 16px 16px;
    box-shadow: 0 8px 32px rgba(10, 31, 68, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 12px;
    overflow: visible;
    z-index: 2;
    transition: height 0.3s ease;
}

.scale-pan:before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 20px;
    background: #0A1F44;
    border-radius: 2px;
}

.left-pan {
    left: 20px;
}

.right-pan {
    right: 20px;
}

.pan-label {
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    color: #0A1F44;
    background: #F5F7FA;
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid #E5E7EB;
}

.flags-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    align-items: center;
    flex-grow: 1;
}

.flag-block {
    width: 85%;
    min-height: 30px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 500;
    text-align: center;
    color: white;
    cursor: pointer;
    position: relative;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    line-height: 1.4;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.flag-block:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    z-index: 10;
}

.flag-block.red {
    background: linear-gradient(135deg, #E74C3C 0%, #C0392B 100%);
}

.flag-block.green {
    background: linear-gradient(135deg, #2ECC71 0%, #27AE60 100%);
}

.flag-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    background: white;
    color: #E74C3C;
    border: 2px solid #E74C3C;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 20;
}

.flag-remove:hover {
    background: #E74C3C;
    color: white;
    transform: scale(1.1);
}

.flag-block:hover .flag-remove {
    display: flex;
}

.flag-tooltip {
    position: absolute;
    background: #0A1F44;
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    max-width: 250px;
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    box-shadow: 0 8px 24px rgba(10, 31, 68, 0.3);
}

.flag-tooltip:after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #0A1F44;
}

.flag-tooltip.show {
    opacity: 1;
}

.flag-tooltip.tooltip-below:after {
    top: -12px;
    border-top-color: transparent;
    border-bottom-color: #0A1F44;
}

.flag-tooltip.tooltip-right:after {
    top: 50%;
    left: -12px;
    transform: translateY(-50%);
    border-top-color: transparent;
    border-right-color: #0A1F44;
}

.flag-tooltip.tooltip-left:after {
    top: 50%;
    right: -12px;
    left: auto;
    transform: translateY(-50%);
    border-top-color: transparent;
    border-left-color: #0A1F44;
}
.decision-output {
    margin-top: 80px;
    text-align: center;
    background: #FAFBFC;
    padding: 32px;
    border-radius: 16px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 2px solid #E5E7EB;
    max-width: 600px;
    width: 100%;
    position: relative;
    z-index: 5;
}

.decision-output h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #0A1F44;
}

.decision-result {
    font-size: 1.125rem;
    font-weight: 600;
    padding: 20px 24px;
    border-radius: 12px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    line-height: 1.4;
}

.decision-result.approve {
    background: linear-gradient(135deg, #d5f4e6 0%, #c8f2d4 100%);
    color: #1e7e34;
    border-color: #2ECC71;
    box-shadow: 0 4px 16px rgba(46, 204, 113, 0.15);
}

.decision-result.conditions {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
    border-color: #ffc107;
    box-shadow: 0 4px 16px rgba(255, 193, 7, 0.15);
}

.decision-result.deny {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border-color: #E74C3C;
    box-shadow: 0 4px 16px rgba(231, 76, 60, 0.15);
}

.decision-result.neutral {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    color: #495057;
    border-color: #6c757d;
    box-shadow: 0 4px 16px rgba(108, 117, 125, 0.1);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 350px 1fr;
        gap: 32px;
    }
    
    .scale-beam {
        width: 540px;
    }
    
    .scale-pan {
        width: 180px;
    }
}

@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    
    .sidebar {
        position: static;
        order: 2;
    }
    
    .scale-area {
        order: 1;
    }
    
    .scale-beam {
        width: 480px;
    }
    
    .scale-pan {
        width: 160px;
        min-height: 100px;
    }
    
    .container {
        padding: 24px 16px;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2.25rem;
    }
    
    header p {
        font-size: 1rem;
    }
    
    .scale-beam {
        width: 400px;
    }
    
    .scale-pan {
        width: 140px;
        min-height: 80px;
    }
    
    .left-pan {
        left: 20px;
    }
    
    .right-pan {
        right: 20px;
    }
    
    .button-group {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .scale-beam {
        width: 300px;
    }
    
    .scale-pan {
        width: 110px;
        padding: 12px 8px;
    }
    
    .left-pan {
        left: 15px;
    }
    
    .right-pan {
        right: 15px;
    }
    
    .flag-block {
        font-size: 10px;
        padding: 8px 10px;
    }
    .scale-area {
        padding: 30px 30px 80px 30px;
    }
    
    .decision-output {
        margin-top: 100px;
    }
    
}