/* ===== FONT FACE DEFINITION ===== */
@font-face {
    font-family: "RidleyGrotesk-Light";
    src: url("https://db.onlinewebfonts.com/t/be5a277d24349f7d8512a167b25190ee.eot");
    src: url("https://db.onlinewebfonts.com/t/be5a277d24349f7d8512a167b25190ee.eot?#iefix") format("embedded-opentype"),
         url("https://db.onlinewebfonts.com/t/be5a277d24349f7d8512a167b25190ee.woff2") format("woff2"),
         url("https://db.onlinewebfonts.com/t/be5a277d24349f7d8512a167b25190ee.woff") format("woff"),
         url("https://db.onlinewebfonts.com/t/be5a277d24349f7d8512a167b25190ee.ttf") format("truetype"),
         url("https://db.onlinewebfonts.com/t/be5a277d24349f7d8512a167b25190ee.svg#RidleyGrotesk-Light") format("svg");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

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

body {
    font-family: "RidleyGrotesk-Light", sans-serif, Arial, Verdana, sans-serif;
    font-weight: 300;
    color: #1a1a1a;
    background: #D6DADC;
    min-height: 100vh;
    padding: 24px;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 18px 40px rgba(14, 24, 45, 0.15);
    border: 1px solid rgba(28, 37, 66, 0.1);
    overflow: hidden;
    padding: 0;
}

/* Header */
.header {
    background: #ffffff;
    color: #1C2542;
    padding: 29px 36px;
    border-radius: 18px 18px 0 0;
    display: grid;
    grid-template-columns: 1fr 3fr 1fr;
    align-items: center;
    gap: 24px;
    box-shadow: 0 12px 30px rgba(14, 24, 45, 0.12);
    border-bottom: 1px solid rgba(28, 37, 66, 0.08);
}

.header-left {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.header-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    border: none;
    text-decoration: none;
}

.header-logo img {
    height: 45px;
    width: auto;
    display: block;
}

.header-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    justify-self: center;
}

.header-actions {
    display: flex;
    flex-direction: row;
    gap: 10px;
    justify-content: flex-end;
    justify-self: end;
}

.header-center h1 {
    font-size: 2.2rem;
    margin-bottom: 8px;
    color: #1C2542;
    letter-spacing: 0.02em;
    font-weight: 500;
}

.subtitle {
    font-size: 1.05rem;
    color: #2d3f72;
    margin: 0;
    line-height: 1.4;
    font-weight: 300;
}

.header-meta {
    font-size: 0.85rem;
    color: #666;
    font-weight: 400;
    margin-top: 4px;
    display: block;
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 2px solid #e0e0e0;
    background: #f5f5f5;
}

.tab-btn {
    flex: 1;
    padding: 15px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    background: #e8e8e8;
}

.tab-btn.active {
    background: white;
    border-bottom-color: #1C2542;
    color: #1C2542;
    font-weight: bold;
}

/* Tab Content */
.tab-content {
    display: none;
    padding: 30px;
}

.tab-content.active {
    display: block;
}

.input-panel {
    padding: 0;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.input-group input[type="text"],
.input-group input[type="number"],
.input-group textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.input-group input:focus,
.input-group textarea:focus {
    outline: none;
    border-color: #1C2542;
}

.info-box {
    background: #e3f2fd;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #2196f3;
    margin-top: 15px;
}

.info-box i {
    color: #2196f3;
    margin-right: 8px;
}

/* Upload Zone */
.upload-zone {
    border: 3px dashed #1C2542;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-zone:hover {
    background: #f0f4ff;
}

.upload-zone i {
    color: #1C2542;
    margin-bottom: 15px;
}

.file-types {
    color: #666;
    font-size: 0.9em;
    margin-top: 10px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.btn-primary {
    background: linear-gradient(135deg, #1C2542 0%, #2d3f72 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(28, 37, 66, 0.2);
}

.btn-primary:hover {
    background: #1C2542;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(28, 37, 66, 0.4);
    color: white;
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

.btn-download {
    background: #4caf50;
    color: white;
}

.btn-download:hover {
    background: #45a049;
}

.action-buttons {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
}

/* Status Boxes */
.status-box {
    padding: 15px 20px;
    border-radius: 8px;
    margin: 15px 0;
}

.status-box.success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.status-box.warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

.status-box.error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

/* Output Panel */
.output-panel {
    padding: 30px;
    border-top: 2px solid #e0e0e0;
}

.drawing-container {
    background: white;
    border: 2px solid #ddd;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    overflow: auto;
}

#svg-drawing {
    width: 100%;
    display: flex;
    justify-content: center;
}

/* Table */
.table-container {
    margin: 30px 0;
}

.table-container h3 {
    margin-bottom: 15px;
    color: #333;
}

#points-table table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

#points-table th {
    background: #1C2542;
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

#points-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e0e0e0;
}

#points-table tr:last-child td {
    border-bottom: none;
}

#points-table tr:hover {
    background: #f5f5f5;
}

/* Download Buttons */
.download-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 30px;
}

/* Settings Grid */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.settings-group {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #e0e0e0;
}

.settings-group h4 {
    margin-bottom: 15px;
    color: #1C2542;
    border-bottom: 2px solid #1C2542;
    padding-bottom: 8px;
}

.settings-group label {
    display: block;
    margin: 8px 0;
}

.settings-group small {
    display: block;
    color: #666;
    font-size: 0.85em;
    margin-top: 5px;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        border-radius: 10px;
    }

    .header {
        padding: 22px 20px;
        grid-template-columns: 1fr;
        row-gap: 18px;
    }

    .header-left {
        justify-content: center;
    }

    .header-logo img {
        height: 40px;
    }

    .header-center {
        text-align: center;
        align-items: center;
    }

    .header-actions {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .header-center h1 {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    /* Tabs - responsive */
    .tabs {
        flex-wrap: wrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tab-btn {
        padding: 12px 16px;
        font-size: 0.9rem;
        min-width: fit-content;
        white-space: nowrap;
    }

    .tab-content {
        padding: 20px 15px;
    }

    .input-panel {
        padding: 0;
    }

    /* Buttons - full width on mobile */
    .btn {
        width: 100%;
        justify-content: center;
        margin-bottom: 10px;
    }

    .action-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .download-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .settings-group {
        padding: 15px;
    }

    /* Input groups */
    .input-group {
        margin-bottom: 15px;
    }

    .input-group input[type="text"],
    .input-group input[type="number"],
    .input-group textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    /* Upload zone */
    .upload-zone {
        padding: 30px 20px;
    }

    /* Output panel */
    .output-panel {
        padding: 20px 15px;
    }

    /* Drawing container */
    .drawing-container {
        padding: 15px;
        margin: 15px 0;
        max-height: 70vh;
        overflow: auto;
    }

    /* Table container */
    .table-container {
        margin: 20px 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table-container h3 {
        font-size: 1.3rem;
    }

    #points-table table {
        min-width: 600px;
        font-size: 0.85rem;
    }

    #points-table th,
    #points-table td {
        padding: 8px 10px;
    }

    /* Info box */
    .info-box {
        padding: 12px;
        font-size: 0.9rem;
    }
}

/* Medium screens (tablets) */
@media (min-width: 769px) and (max-width: 1024px) {
    body {
        padding: 15px;
    }

    .container {
        max-width: 100%;
    }

    .header {
        padding: 24px 28px;
    }

    .settings-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
    }

    .drawing-container {
        max-height: 75vh;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    body {
        padding: 5px;
    }

    .container {
        border-radius: 8px;
    }

    .header {
        padding: 18px 15px;
    }

    .header-center h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .tab-btn {
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    .tab-content {
        padding: 15px 10px;
    }

    .input-group input[type="text"],
    .input-group input[type="number"],
    .input-group textarea {
        padding: 8px;
        font-size: 16px;
    }

    .upload-zone {
        padding: 20px 15px;
    }

    .upload-zone i {
        font-size: 2rem;
    }

    .settings-group {
        padding: 12px;
    }

    .drawing-container {
        padding: 10px;
        max-height: 60vh;
    }

    #points-table table {
        font-size: 0.75rem;
        min-width: 500px;
    }

    #points-table th,
    #points-table td {
        padding: 6px 8px;
    }
}

/* Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.output-panel {
    animation: fadeIn 0.5s ease-in;
}

/* Disabled/Unused Settings */
.setting-disabled {
    opacity: 0.6;
    position: relative;
}

.setting-disabled input,
.setting-disabled textarea,
.setting-disabled select {
    background-color: #f0f0f0 !important;
    cursor: not-allowed !important;
    opacity: 0.6;
    border-color: #ccc !important;
}

.setting-disabled input:disabled,
.setting-disabled textarea:disabled,
.setting-disabled select:disabled {
    background-color: #f0f0f0;
    cursor: not-allowed;
}

/* Allow specific inputs to be enabled even in disabled group */
.setting-disabled input:not(:disabled),
.setting-disabled textarea:not(:disabled),
.setting-disabled select:not(:disabled) {
    background-color: #fff !important;
    cursor: auto !important;
    opacity: 1 !important;
    border-color: #ddd !important;
}

.setting-disabled label {
    color: #999;
}

.setting-disabled .input-group label {
    color: #999;
}

/* Enable labels for non-disabled inputs */
.setting-disabled .input-group:has(input:not(:disabled)) label {
    color: #333;
}

.setting-disabled small {
    display: block;
    font-size: 0.85em;
    color: #999;
    font-style: italic;
    margin-top: 5px;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    margin-top: 30px;
    border-top: 1px solid #e0e0e0;
    color: #666;
    font-size: 0.9em;
    background: white;
    border-radius: 0 0 20px 20px;
}

footer a {
    transition: opacity 0.2s ease;
    text-decoration: none;
}

footer a:hover {
    opacity: 0.8;
}

footer img {
    transition: transform 0.2s ease;
}

footer a:hover img {
    transform: scale(1.05);
}

