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

:root {
    --primary-color: #4361ee;
    --secondary-color: #3a0ca3;
    --accent-color: #f72585;
    --background-color: #f8f9fa;
    --text-color: #2b2d42;
    --light-gray: #e9ecef;
    --dark-gray: #6c757d;
    --success-color: #4cc9f0;
    --warning-color: #f8961e;
    --shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --gradient: linear-gradient(135deg, var(--primary-color), var(--accent-color));
}

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

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Header Styles */
header {
    background: var(--gradient);
    color: white;
    padding: 1.5rem 2rem;
    text-align: center;
    box-shadow: 0 4px 20px rgba(67, 97, 238, 0.2);
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c0 1.657-1.343 3-3 3s-3-1.343-3-3 1.343-3 3-3 3 1.343 3 3zm60-50c0 1.657-1.343 3-3 3s-3-1.343-3-3 1.343-3 3-3 3 1.343 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29-22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23ffffff' fill-opacity='0.1' fill-rule='evenodd'/%3E%3C/svg%3E");
    opacity: 0.5;
    z-index: 0;
}

header .logo {
    height: 70px;
    margin-right: 1.5rem;
    vertical-align: middle;
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

header .logo:hover {
    transform: rotate(10deg) scale(1.1);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

header h1 {
    display: inline-block;
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    vertical-align: middle;
    position: relative;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Main Container */
.container {
    display: flex;
    flex: 1;
    padding: 2rem;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
    gap: 1.5rem;
}

/* Sidebar Styles */
.sidebar {
    width: 300px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius);
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.1);
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition);
}

.sidebar:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(67, 97, 238, 0.15);
}

.sidebar h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.sidebar h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: var(--gradient);
    border-radius: 3px;
}

/* Shape Options */
.shape-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 0.8rem;
    margin: 1.5rem 0;
}

.shape-options button {
    padding: 0.8rem 0.5rem;
    border: 2px solid transparent;
    border-radius: var(--border-radius);
    background: white;
    color: var(--text-color);
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    font-size: 0.9rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.shape-options button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient);
    opacity: 0;
    z-index: -1;
    transition: var(--transition);
}

.shape-options button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(67, 97, 238, 0.2);
    color: white;
}

.shape-options button:hover::before {
    opacity: 1;
}

.shape-options button.active {
    background: var(--gradient);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(67, 97, 238, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Action Buttons */
.action-btn {
    width: 100%;
    padding: 0.9rem 1.2rem;
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 1.2rem;
    position: relative;
    overflow: hidden;
    z-index: 1;
    box-shadow: 0 4px 15px rgba(67, 97, 238, 0.3);
}

.action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
    z-index: -1;
    opacity: 0;
    transition: var(--transition);
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 20px rgba(67, 97, 238, 0.4);
}

.action-btn:hover::before {
    opacity: 1;
}

.action-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 10px rgba(67, 97, 238, 0.3);
}

/* 3D Canvas Container */
.canvas-container {
    flex: 1;
    position: relative;
    background: #ffffff;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    min-height: 600px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

#canvas-container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    outline: none;
}

/* Parameter Groups - Enhanced Design */
.parameter-group {
    margin-bottom: 1rem;
    background: linear-gradient(145deg, #ffffff, #f8faff);
    padding: 1rem;
    border-radius: 8px;
    border: none;
    box-shadow: 0 8px 24px rgba(67, 97, 238, 0.08);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    overflow: hidden;
}

.parameter-group::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gradient);
    transition: all 0.4s ease;
}

.parameter-group:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(67, 97, 238, 0.15);
}

.parameter-group:hover::before {
    width: 6px;
    background: var(--accent-color);
}

.parameter-group h3 {
    font-size: 1.3rem;
    margin: 0 0 1.5rem 0;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.8rem;
    position: relative;
    padding-bottom: 0.8rem;
}

.parameter-group h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: var(--gradient);
    border-radius: 3px;
}

.parameter {
    margin-bottom: 1.5rem;
    position: relative;
    padding: 0.5rem 0;
}

.parameter:last-child {
    margin-bottom: 0.5rem;
}

.parameter label {
    display: block;
    margin-bottom: 0.7rem;
    font-weight: 600;
    color: var(--text-color);
    font-size: 1.05rem;
    letter-spacing: 0.3px;
    position: relative;
    padding-left: 1.8rem;
}

.parameter label::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-size: 1.8rem;
    line-height: 1;
    top: 50%;
    transform: translateY(-60%);
}

.parameter input {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    font-size: 1.05rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 8px rgba(67, 97, 238, 0.05);
    font-family: 'Poppins', sans-serif;
    color: var(--text-color);
    font-weight: 500;
}

.parameter input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(67, 97, 238, 0.15);
    background: #ffffff;
}

/* Style for parameter value display */
.parameter .value-display {
    display: inline-block;
    margin-left: 0.5rem;
    font-weight: 700;
    color: var(--primary-color);
    background: rgba(67, 97, 238, 0.1);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.95rem;
    min-width: 60px;
    text-align: center;
}

/* Unit indicator */
.parameter .unit {
    position: absolute;
    right: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--dark-gray);
    font-size: 0.9rem;
    pointer-events: none;
    background: rgba(255, 255, 255, 0.8);
    padding: 0 0.5rem;
    border-radius: 4px;
}

/* For parameter groups with multiple inputs */
.parameter-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.parameter-col {
    flex: 1;
    position: relative;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .parameter-row {
        flex-direction: column;
        gap: 1.2rem;
    }

    .parameter input {
        padding: 0.9rem 1.1rem;
    }

    .parameter-group {
        padding: 1.2rem;
    }
}

/* Results Section */
.results {
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(67, 97, 238, 0.1);
    position: relative;
    overflow: hidden;
}

.results::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gradient);
}

.result-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.8rem;
    padding: 0.8rem 0;
    font-size: 1rem;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.05);
}

.result-item:last-child {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.result-item .label {
    color: var(--text-color);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.result-item .value {
    font-weight: 700;
    color: var(--primary-color);
    background: rgba(67, 97, 238, 0.1);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.95rem;
    min-width: 100px;
    text-align: right;
}

/* Net Viewer */
.net-viewer {
    margin-top: 1.5rem;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

.net-viewer img {
    width: 100%;
    height: auto;
    display: block;
}

.net-viewer.hidden {
    display: none;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .container {
        padding: 1.5rem;
    }

    .sidebar {
        width: 280px;
    }
}

@media (max-width: 992px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        margin-bottom: 1.5rem;
    }

    .canvas-container {
        min-height: 500px;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.75rem;
    }

    .container {
        padding: 1rem;
    }

    .shape-options {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

.float {
    animation: float 3s ease-in-out infinite;
}

/* Tooltip */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.85rem;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 10px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: rgba(0, 0, 0, 0.8) transparent transparent transparent;
    margin-bottom: 5px;
    opacity: 0;
    transition: opacity 0.3s;
}

[data-tooltip]:hover::after,
[data-tooltip]:hover::before {
    opacity: 1;
}