/* Modal styles */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.options-modal,
.saved-monsters-modal,
.view-saved-monster-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.view-saved-monster-modal {
    z-index: 1001;
}

.options-content,
.saved-monsters-content,
.view-saved-monster-content {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.options-content {
    max-width: 400px;
    width: 90%;
}

.saved-monsters-content {
    max-width: 90vw;
    max-height: 90vh;
    width: 800px;
    overflow: auto;
}

.view-saved-monster-content {
    max-width: 95vw;
    max-height: 95vh;
    width: 1000px;
    overflow: auto;
}

.options-header,
.saved-monsters-header,
.view-saved-monster-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
}

.options-header h3,
.saved-monsters-header h3 {
    color: #2d3748;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.view-saved-monster-header h3 {
    color: #2d3748;
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.option-item {
    margin-bottom: 20px;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    cursor: pointer;
}

.toggle-label input {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 50px;
    height: 24px;
    background: #cbd5e0;
    border-radius: 24px;
    transition: background 0.3s ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-label input:checked + .toggle-slider {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.toggle-label input:checked + .toggle-slider::before {
    transform: translateX(26px);
}

.option-description {
    font-size: 0.85rem;
    color: #718096;
    margin: 8px 0 0 62px;
    line-height: 1.4;
}

.saved-monsters-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.saved-monster-card {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border: 2px solid #e2e8f0;
    border-radius: 15px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.saved-monster-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.saved-monster-thumbnail {
    width: 100%;
    height: 120px;
    object-fit: contain;
    border-radius: 10px;
    margin-bottom: 10px;
}

.saved-monster-name {
    font-size: 1rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 5px;
}

.saved-monster-elements {
    font-size: 0.8rem;
    color: #718096;
    margin-bottom: 10px;
}

.no-saved-monsters {
    text-align: center;
    color: #718096;
    font-size: 1.1rem;
    padding: 40px 20px;
}

.view-saved-monster-display {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    grid-template-rows: auto auto;
    gap: 30px;
    margin-bottom: 30px;
    align-items: start;
}

.view-saved-monster-info {
    grid-column: 1;
    grid-row: 1;
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border: 1px solid #e2e8f0;
}

.view-saved-monster-images {
    grid-column: 2;
    grid-row: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.view-saved-monster-description {
    grid-column: 1 / -1;
    grid-row: 2;
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border: 1px solid #e2e8f0;
}

.view-saved-monster-actions {
    text-align: center;
    margin-top: 20px;
}

.islands-modal,
.island-view-modal,
.breeding-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.islands-content,
.island-view-content,
.breeding-content {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
}

.islands-content {
    width: 800px;
}

.island-view-content {
    width: 1000px;
}

.breeding-content {
    width: 600px;
}

.islands-header,
.island-view-header,
.breeding-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
}

.islands-header h3,
.island-view-header h3,
.breeding-header h3 {
    color: #2d3748;
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.islands-actions {
    text-align: center;
    margin-bottom: 30px;
}

.islands-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.island-card {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border: 2px solid #e2e8f0;
    border-radius: 15px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.island-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border-color: #4299e1;
}

.island-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
}

.island-monsters,
.island-size {
    font-size: 0.9rem;
    color: #718096;
    margin-bottom: 5px;
}

.no-islands {
    text-align: center;
    color: #718096;
    font-size: 1.1rem;
    padding: 40px 20px;
}

.island-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 20px;
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border-radius: 15px;
    border: 1px solid #e2e8f0;
}

.island-stats {
    font-size: 1.1rem;
    font-weight: 600;
    color: #4a5568;
}

.island-actions {
    text-align: center;
    margin-bottom: 30px;
}

.island-monsters h4 {
    color: #2d3748;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.island-monsters-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.island-monster-card {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
}

.island-monster-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.island-monster-image {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 8px;
}

.island-monster-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 5px;
}

.island-monster-elements {
    font-size: 0.7rem;
    color: #718096;
    margin-bottom: 8px;
}

.empty-island-message {
    text-align: center;
    color: #718096;
    font-size: 1rem;
    padding: 30px 20px;
    background: linear-gradient(145deg, #f8fafc, #edf2f7);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.breeding-body p {
    text-align: center;
    color: #4a5568;
    margin-bottom: 25px;
    font-size: 1.1rem;
}

.breeding-selection {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    justify-content: center;
}

.parent-selection {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 200px;
}

.parent-selection label {
    font-weight: 600;
    color: #2d3748;
    font-size: 1rem;
}

.parent-selection select {
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    color: #2d3748;
}

.parent-selection select:focus {
    outline: none;
    border-color: #667eea;
}

.breeding-plus {
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
    margin-top: 20px;
}

.breeding-actions {
    text-align: center;
}