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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #dc143c 0%, #8b0000 100%);
    min-height: 100vh;
    padding: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 3rem;
    max-width: 1100px;
    width: 100%;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 2.5rem;
    font-size: 2.5rem;
}

.header-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-section h1 {
    margin-bottom: 0;
    flex: 1;
    min-width: 250px;
    text-align: center;
}

.button-group {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.action-button {
    padding: 0.6rem 1.2rem;
    background-color: #dc143c;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.action-button:hover {
    background-color: #8b0000;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(220, 20, 60, 0.3);
}

.action-button:active {
    transform: scale(0.98);
}

.info-button {
    padding: 0.6rem 1.2rem;
    background-color: #dc143c;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.info-button:hover {
    background-color: #8b0000;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(220, 20, 60, 0.3);
}

.info-button:active {
    transform: scale(0.98);
}

/* Copy Notification */
.copy-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #28a745;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    animation: slideInRight 0.3s ease;
}

.copy-notification.hidden {
    display: none;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Modal Styles */
.modal {
    display: flex;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background-color: white;
    border-radius: 12px;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
    border-bottom: 2px solid #dc143c;
    background: linear-gradient(135deg, #f8f9ff 0%, #ffe6e6 100%);
}

.modal-header h2 {
    margin: 0;
    color: #333;
    font-size: 1.8rem;
}

.close-button {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #dc143c;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-button:hover {
    color: #8b0000;
    transform: scale(1.2);
}

.modal-body {
    padding: 2rem;
    color: #555;
    line-height: 1.6;
}

.modal-body h3 {
    color: #dc143c;
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
    font-size: 1.3rem;
}

.modal-body h3:first-child {
    margin-top: 0;
}

.modal-body p {
    margin-bottom: 0.8rem;
}

.modal-body ul {
    margin: 1rem 0 1rem 2rem;
    padding: 0;
}

.modal-body li {
    margin-bottom: 0.6rem;
}

.unit-info {
    background-color: #f8f9ff;
    padding: 1.2rem;
    border-left: 4px solid #dc143c;
    margin-bottom: 1.2rem;
    border-radius: 4px;
}

.unit-info h4 {
    color: #dc143c;
    margin: 0 0 0.6rem 0;
    font-size: 1.1rem;
}

.unit-info p {
    margin: 0.5rem 0;
}

.main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

.inputs-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-weight: 600;
    color: #555;
    font-size: 0.95rem;
}

.input-group input {
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #dc143c;
    background-color: #ffe6e6;
    box-shadow: 0 0 0 3px rgba(220, 20, 60, 0.1);
}

.canvas-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

canvas {
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    max-width: 100%;
    height: auto;
}

.angle-display {
    text-align: center;
    font-size: 1.3rem;
    font-weight: 600;
    color: #dc143c;
}

@media (max-width: 768px) {
    .main-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .container {
        padding: 2rem;
    }

    h1 {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }
}

.unit-symbol {
    color: #999;
    font-size: 0.85rem;
    font-style: italic;
}
