/* UI Components - Buttons, Modals, Game Areas, Controls */

/* Buttons */
.play-btn {
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    color: white;
    border: none;
    padding: 15px 35px;
    border-radius: 25px;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 1px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    min-height: 48px;
    min-width: 48px;
}

.play-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.back-btn {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.back-btn:hover {
    background: #ff5252;
    transform: scale(1.05);
}

.control-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.control-btn.primary {
    background: linear-gradient(45deg, #4ecdc4, #45b7d1);
}

.control-btn.primary:hover {
    transform: translateY(-2px) scale(1.05);
}

.submit-btn {
    background: linear-gradient(45deg, #4ecdc4, #45b7d1);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    transition: all 0.3s ease;
}

.submit-btn:hover {
    transform: scale(1.05);
}

/* Game Area */
.game-area {
    display: none;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    margin-top: 30px;
    text-align: center;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.game-info {
    display: flex;
    gap: 30px;
    align-items: center;
    flex-wrap: wrap;
}

.score, .timer, .rate {
    font-size: 1.3em;
    font-weight: bold;
    padding: 10px 20px;
    background: rgba(0,0,0,0.2);
    border-radius: 15px;
}

.high-score-display {
    font-size: 1.1em;
    opacity: 0.8;
}

.progress {
    width: 200px;
    height: 10px;
    background: rgba(255,255,255,0.2);
    border-radius: 5px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(45deg, #4ecdc4, #45b7d1);
    transition: width 0.3s ease;
    width: 0%;
}

/* Controls */
.controls {
    margin: 30px 0;
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.instructions {
    margin-top: 20px;
    font-size: 1.1em;
    opacity: 0.8;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 10% auto;
    padding: 40px;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    position: relative;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 2em;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.close:hover {
    opacity: 1;
}

.modal h2 {
    margin-bottom: 30px;
    font-size: 2em;
}

#playerName {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 15px;
    font-size: 1.2em;
    margin-bottom: 20px;
    text-align: center;
    background: rgba(255,255,255,0.9);
    color: #333;
}

#playerName:focus {
    outline: 3px solid #4ecdc4;
}

.modal-score {
    background: rgba(255,255,255,0.1);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 30px;
    font-size: 1.3em;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.modal-buttons button:last-child {
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Contact Form */
.contact-section {
    margin: 50px 0 30px;
    padding: 40px;
    background: rgba(255,255,255,0.05);
    border-radius: 20px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.1);
}

.contact-section h3 {
    font-size: 2em;
    margin-bottom: 15px;
    color: #4ecdc4;
}

.contact-section p {
    font-size: 1.1em;
    margin-bottom: 30px;
    opacity: 0.9;
}

.contact-form {
    max-width: 500px;
    margin: 0 auto;
    text-align: left;
}

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 10px;
    background: rgba(255,255,255,0.9);
    color: #333;
    font-size: 1em;
    font-family: inherit;
    resize: vertical;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: 3px solid #4ecdc4;
    background: #fff;
    transform: scale(1.02);
}

.contact-btn {
    width: 100%;
    background: linear-gradient(45deg, #4ecdc4, #45b7d1);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 15px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.contact-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(78, 205, 196, 0.3);
}

.contact-btn:active {
    transform: translateY(0);
}

.contact-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 10px;
    font-weight: bold;
    text-align: center;
    display: none;
}

.contact-message.success {
    background: rgba(76, 175, 80, 0.2);
    border: 1px solid #4caf50;
    color: #4caf50;
    display: block;
}

.contact-message.error {
    background: rgba(244, 67, 54, 0.2);
    border: 1px solid #f44336;
    color: #f44336;
    display: block;
}

/* Touch-friendly interactions for all interactive elements */
button, .btn, .game-card, .memory-card, .quiz-option, .key, .upgrade-btn, .difficulty-btn, .contact-btn {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    min-height: 44px;
    min-width: 44px;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Add active states for touch feedback */
button:active, .btn:active, .game-card:active, .memory-card:active, .quiz-option:active, .key:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

/* Prevent zoom on double tap for iOS */
input, textarea, select {
    font-size: 16px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}