/* ============================================
   Gon Stock Frontend - Style Sheet
   ============================================ */

/* --- Reset & Base --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

/* --- Container --- */
.container {
    max-width: 900px;
    margin: 0 auto;
}

/* --- Header --- */
.header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

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

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

/* --- Section Header --- */
.section-header {
    color: white;
    font-size: 1.6em;
    margin: 30px 0 20px 0;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
}

/* --- Card Grid --- */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* --- Card --- */
.card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.card h3 {
    font-size: 1.3em;
    margin-bottom: 10px;
    color: #333;
}

.card p {
    color: #666;
    margin-bottom: 20px;
    font-size: 0.9em;
}

/* --- Buttons --- */
.btn {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    color: white;
}

.btn:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.btn-success {
    background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
    color: #333;
}

.btn-warning {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: #333;
}

.btn-info {
    background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
}

/* Card span 2 */
.card-span-2 {
    grid-column: span 2;
}

/* --- Output Box --- */
.output-box {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.output-box h3 {
    margin-bottom: 15px;
    color: #333;
}

#output {
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.85em;
    white-space: pre-wrap;
    color: #333;
    line-height: 1.6;
}

/* --- File Status Grid --- */
.file-status-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

/* --- Collapsible Sections --- */
.collapsible-header {
    width: 100%;
    border-radius: 12px;
    margin: 0;
    padding: 20px;
    font-size: 1.1em;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.collapsible-content {
    display: none;
    padding: 20px;
    border-top: 1px solid #eee;
}

.collapsible-content.open {
    display: block;
}

/* --- Long Description Toggle --- */
.long-desc {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, margin-bottom 0.3s ease-out;
    font-size: 0.85em;
    color: #7f8c8d;
    line-height: 1.4;
    margin-bottom: 0;
    text-align: left;
}

.long-desc.open {
    max-height: 300px;
    margin-bottom: 20px;
}

.learn-more {
    display: block;
    margin-bottom: 15px;
    color: #667eea;
    text-decoration: none;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s;
}

.learn-more:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* --- Loading Spinner --- */
.loading {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #667eea;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- Pulse Animation --- */
@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(102, 126, 234, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* --- Inline utility classes --- */
.flex-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-wrap {
    flex-wrap: wrap;
}

.gap-10 { gap: 10px; }
.gap-15 { gap: 15px; }
.gap-20 { gap: 20px; }

.mb-5 { margin-bottom: 5px; }
.mb-10 { margin-bottom: 10px; }
.mb-15 { margin-bottom: 15px; }
.mb-20 { margin-bottom: 20px; }

.mt-10 { margin-top: 10px; }
.mt-15 { margin-top: 15px; }
.mt-20 { margin-top: 20px; }

.text-center { text-align: center; }
.text-small { font-size: 0.8em; }
.text-mono { font-family: 'Monaco', 'Courier New', monospace; }
.text-bold { font-weight: 600; }

/* --- Responsive --- */
@media (max-width: 768px) {
    .cards {
        grid-template-columns: 1fr;
    }
    .card-span-2 {
        grid-column: span 1;
    }
    .file-status-grid {
        grid-template-columns: 1fr;
    }
    .header h1 {
        font-size: 1.8em;
    }
    .flex-row {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    .card {
        padding: 20px;
    }
}
