/* ===== Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    color: #fff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ===== Header ===== */
header {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

header h1 {
    text-align: center;
    color: #e74c3c;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.install-btn {
    display: block;
    margin: 0 auto 15px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
}

.install-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
}

.install-guide {
    text-align: center;
    font-size: 12px;
    color: #aaa;
    margin-bottom: 10px;
    padding: 8px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
}

.header-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 12px;
    color: #aaa;
    margin-bottom: 5px;
}

.form-group input,
.form-group select {
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #e74c3c;
}

/* ===== Main Content ===== */
main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    main {
        grid-template-columns: 1fr;
    }
}

/* ===== Section Styles ===== */
section {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 12px;
}

section h2 {
    color: #e74c3c;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.hint {
    font-size: 12px;
    color: #aaa;
    margin-bottom: 15px;
}

/* ===== Strike Zone ===== */
.strike-zone-container {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

#strikeZoneCanvas {
    border: 2px solid #333;
    border-radius: 12px;
    cursor: crosshair;
    max-width: 100%;
}

.zone-legend {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 15px 0;
    font-size: 13px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid #fff;
}

.dot.green { background: #2ecc71; }
.dot.orange { background: #e67e22; }

/* ===== Data Entry ===== */
.data-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.input-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.input-group label {
    font-size: 14px;
    color: #ccc;
}

.number-input {
    display: flex;
    align-items: center;
    gap: 5px;
}

.number-input input {
    width: 60px;
    text-align: center;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 16px;
}

/* ===== Buttons ===== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-plus,
.btn-minus {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 6px;
}

.btn-plus:hover,
.btn-minus:hover {
    background: rgba(255, 255, 255, 0.3);
}

.btn-primary {
    background: #e74c3c;
    color: #fff;
}

.btn-primary:hover {
    background: #c0392b;
}

.btn-secondary {
    background: #3498db;
    color: #fff;
}

.btn-secondary:hover {
    background: #2980b9;
}

.btn-danger {
    background: #e74c3c;
    color: #fff;
}

.btn-danger:hover {
    background: #c0392b;
}

/* ===== Stats Summary ===== */
.stats-summary {
    margin-top: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.stats-summary h3 {
    color: #3498db;
    margin-bottom: 15px;
    font-size: 1em;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-item.highlight {
    color: #f39c12;
}

.stat-label {
    color: #aaa;
}

.stat-value {
    font-weight: bold;
    font-size: 1.1em;
}

/* ===== History Section ===== */
.history-section {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.history-section h3 {
    color: #3498db;
    margin-bottom: 10px;
    font-size: 1em;
}

.history-list {
    margin-top: 10px;
    max-height: 200px;
    overflow-y: auto;
}

.history-item {
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 0.3s;
}

.history-item:hover {
    background: rgba(0, 0, 0, 0.3);
}

.history-date {
    font-size: 11px;
    color: #888;
}

.history-name {
    font-size: 14px;
    color: #fff;
    font-weight: 600;
}

.history-stats {
    font-size: 11px;
    color: #aaa;
    margin-top: 3px;
}

/* ===== Footer ===== */
footer {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    padding: 20px;
}

/* ===== Modal ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #1a1a2e;
    padding: 25px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h2 {
    color: #e74c3c;
    margin-bottom: 20px;
    text-align: center;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

/* ===== History Detail ===== */
.history-detail {
    padding: 10px;
}

.history-detail h3 {
    color: #e74c3c;
    margin-bottom: 5px;
}

.history-detail p {
    color: #aaa;
    font-size: 13px;
    margin-bottom: 15px;
}

/* ===== Mobile Responsive ===== */
@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 1.4em;
    }
    
    .header-form {
        grid-template-columns: 1fr;
    }
    
    .zone-legend {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }
    
    footer {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    #strikeZoneCanvas {
        width: 100%;
        height: auto;
    }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}