/* Pokemon Team Builder Styles */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f2f5;
    color: #333;
    line-height: 1.6;
    background-image: url('../images/dark_hunter_background.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
}

.header h1 {
    font-size: 2.2rem;
    color: #1a202c;
    margin-bottom: 10px;
}

.header p {
    font-size: 1.1rem;
    color: #4a5568;
}

/* Loading Screen */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: #4a5568;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(0,0,0,0.1);
    border-top: 5px solid #4299e1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    background: white;
    color: #333;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    max-width: 500px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Team Builder */
.team-builder {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

/* Search Section */
.search-section {
    margin-bottom: 20px;
}

.search-input {
    width: 100%;
    padding: 12px 20px;
    font-size: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.search-input:focus {
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.2);
}

.filter-options {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.filter-select {
    padding: 10px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    outline: none;
    flex: 1;
}

.filter-select:focus {
    border-color: #4299e1;
}

/* Pokemon Grid */
.pokemon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
    max-height: 400px;
    overflow-y: auto;
    padding: 15px;
    background-color: #f7fafc;
    border-radius: 8px;
}

.navigation-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    margin-bottom: 20px;
}

.navigation-buttons .btn {
    flex: 1;
    max-width: 200px;
}

.pokemon-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-align: center;
}

.pokemon-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.07);
    border-color: #a0aec0;
}

.pokemon-sprite img {
    width: 72px;
    height: 72px;
    image-rendering: pixelated;
}

.pokemon-info {
    margin-top: 5px;
}

.pokemon-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.pokemon-types {
    display: flex;
    justify-content: center;
    gap: 3px;
    margin-bottom: 5px;
    flex-wrap: wrap; /* Allow types to wrap on multiple lines */
}

.pokemon-bst {
    font-size: 0.75rem;
    color: #718096;
}

/* Type Badges */
.type-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    border: 1px solid rgba(0,0,0,0.1);
}

.type-normal { background-color: #A8A878; }
.type-fire { background-color: #F08030; }
.type-water { background-color: #6890F0; }
.type-electric { background-color: #F8D030; }
.type-grass { background-color: #78C850; }
.type-ice { background-color: #98D8D8; }
.type-fighting { background-color: #C03028; }
.type-poison { background-color: #A040A0; }
.type-ground { background-color: #E0C068; }
.type-flying { background-color: #A890F0; }
.type-psychic { background-color: #F85888; }
.type-bug { background-color: #A8B820; }
.type-rock { background-color: #B8A038; }
.type-ghost { background-color: #705898; }
.type-dragon { background-color: #7038F8; }
.type-dark { background-color: #705848; }
.type-steel { background-color: #B8B8D0; }
.type-fairy { background-color: #EE99AC; }

/* Selected Pokemon */
.selected-pokemon {
    background: #f7fafc;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.selected-pokemon h3 {
    color: #2d3748;
    margin-bottom: 15px;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 15px;
}

.detail-section {
    background: white;
    padding: 15px;
    border-radius: 8px;
}

.detail-section h4 {
    color: #2d3748;
    margin-bottom: 10px;
}

.stats-display {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    font-size: 0.9rem;
}

/* Team Summary */
.team-summary {
    background: #f7fafc;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.team-summary h3 {
    color: #2d3748;
    margin-bottom: 15px;
}

#teamList {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.team-member {
    display: flex;
    flex-direction: column;
    background: white;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #4299e1;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.member-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.member-sprite img {
    width: 64px;
    height: 64px;
    margin-right: 10px;
    image-rendering: pixelated;
}

.member-info {
    flex: 1;
}

.member-ball img {
    width: 24px;
    height: 24px;
}

.member-details {
    border-top: 1px solid #e2e8f0;
    padding-top: 10px;
}

.member-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.member-item img {
    width: 24px;
    height: 24px;
    margin-right: 10px;
}

.member-moves {
    list-style: none;
    padding: 0;
    margin: 0 0 10px 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
}

.member-stats {
    font-size: 0.8rem;
    color: #4a5568;
}

.stat-group {
    margin-bottom: 5px;
}

.member-actions {
    display: flex;
    gap: 10px;
    align-self: flex-end;
}

.team-analysis {
    margin-top: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;
}

.team-analysis h4 {
    color: #2d3748;
    margin-bottom: 10px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    overflow-y: auto;
    padding: 20px 0;
}

.modal-content {
    background: white;
    margin: 2% auto;
    padding: 25px;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    position: relative;
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
}

.close {
    position: absolute;
    right: 25px;
    top: 15px;
    font-size: 32px;
    font-weight: bold;
    color: #a0aec0;
    cursor: pointer;
    transition: color 0.2s;
}

.close:hover {
    color: #2d3748;
}

/* Editor Tabs */
.editor-tabs {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    border-bottom: 2px solid #e2e8f0;
}

.tab-button {
    padding: 10px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #718096;
    transition: all 0.3s;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.tab-button:hover {
    color: #2d3748;
}

.tab-button.active {
    color: #4299e1;
    border-bottom-color: #4299e1;
}

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

.basic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

/* Form Elements */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #4a5568;
}

.form-input, .form-select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-input:focus, .form-select:focus {
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.2);
}

/* Suggestions */
.suggestions {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    max-height: 150px;
    overflow-y: auto;
    margin-top: 5px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.suggestion-item {
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.suggestion-item:hover {
    background: #edf2f7;
}

/* Moves */
.current-moves {
    margin-bottom: 20px;
}

.current-move {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #f7fafc;
    margin-bottom: 8px;
    border-radius: 8px;
}

.available-moves {
    margin-top: 20px;
}

#availableMovesList {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
    max-height: 350px;
    overflow-y: auto;
    margin-top: 10px;
    padding: 5px;
}

.available-move {
    display: flex;
    flex-direction: column;
    padding: 10px;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.available-move:hover:not(.disabled) {
    background: #e3f2fd;
    border-color: #4299e1;
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.08);
}

.available-move.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #edf2f7;
}

.move-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.move-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.move-type {
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 0.7rem;
    color: white;
}

.move-stats {
    display: flex;
    gap: 8px;
    font-size: 0.75rem;
    color: #718096;
}

.move-physical { color: #c53030; font-weight: bold; }
.move-special { color: #2c5282; font-weight: bold; }
.move-status { color: #2f855a; font-weight: bold; }

/* Stats */
.stats-section {
    margin-bottom: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
}

.stat-input-group {
    background: #f7fafc;
    padding: 10px;
    border-radius: 8px;
}

.stat-input-group label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 5px;
    color: #4a5568;
    font-weight: 600;
}

.stat-input-group input {
    width: 100%;
    padding: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
}

/* Modal Buttons */
.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

/* Export/Import */
.export-section, .import-section {
    background: #f7fafc;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.export-section h3, .import-section h3 {
    color: #2d3748;
    margin-bottom: 15px;
}

.export-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.export-textarea, .import-textarea {
    width: 100%;
    height: 180px;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-family: 'Fira Code', monospace;
    font-size: 13px;
    resize: vertical;
    background-color: #edf2f7;
}

/* Buttons */
.btn {
    background: #4299e1;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn:hover {
    background: #2b6cb0;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.2);
}

.btn-primary {
    background: #4299e1;
}

.btn-primary:hover {
    background: #2b6cb0;
}

.btn-secondary {
    background: #a0aec0;
}

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

.btn-danger {
    background: #e53e3e;
}

.btn-danger:hover {
    background: #c53030;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-tiny {
    padding: 3px 8px;
    font-size: 11px;
    border-radius: 12px;
}

/* Responsive */
@media (max-width: 992px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .pokemon-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-options {
        flex-direction: column;
        gap: 10px;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.6rem;
    }

    .pokemon-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }

    .pokemon-sprite img {
        width: 60px;
        height: 60px;
    }

    .pokemon-name {
        font-size: 0.8rem;
    }

    #teamList {
        grid-template-columns: 1fr;
    }

    .modal-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #edf2f7;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #a0aec0;
    border-radius: 10px;
    border: 2px solid #edf2f7;
}

::-webkit-scrollbar-thumb:hover {
    background: #718096;
}
