/* General Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Header styles */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    margin-bottom: 2rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    animation: fadeInDown 0.5s ease-out;
}

header h1 {
    font-size: 2.5rem;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #fff;
}

/* Button styles */
.btn {
    display: inline-block;
    background: #fff;
    color: #667eea;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
}

.btn:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background-color: #667eea;
    color: #fff;
}

.btn-primary:hover {
    background-color: #5a6fd6;
    color: #fff;
}

/* Main content */
main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    animation: fadeIn 0.8s ease-out;
}

/* Form styles */
.form-container {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 500px;
    animation: slideInUp 0.5s ease-out;
}

.form-container h2 {
    margin-bottom: 1.5rem;
    color: #333;
    text-align: center;
}

.form-group {
    margin-bottom: 1.5rem;
    animation: fadeIn 0.3s ease-out;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-control:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.25);
}

.is-invalid {
    border-color: #dc3545;
}

.invalid-feedback {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    animation: shake 0.5s ease-out;
}

.alert {
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 4px;
    animation: slideInDown 0.3s ease-out;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

/* Game container */
.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 800px;
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.8s ease-out, floatAnimation 4s ease-in-out infinite;
    position: relative;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    gap: 4px;
    width: 100%;
    aspect-ratio: 1/1;
    margin-bottom: 1.5rem;
    background-color: #f0f0f0;
    padding: 10px;
    border-radius: 8px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.1);
    animation: scaleIn 0.5s ease-out;
}

.cell {
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 4px;
    width: 100%;
    height: 0;
    padding-bottom: 100%;
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
}

.cell:hover {
    background-color: rgba(255, 255, 255, 0.9);
    transform: scale(1.02);
}

.cell.drag-over {
    background-color: rgba(255, 255, 255, 1);
    box-shadow: 0 0 0 2px #667eea;
}

.cell .block {
    position: absolute;
    top: 5%;
    left: 5%;
    width: 90%;
    height: 90%;
    animation: popIn 0.3s ease-out;
}

/* Ghost block for preview */
.ghost-block {
    position: absolute;
    top: 5%;
    left: 5%;
    width: 90%;
    height: 90%;
    opacity: 0.6;
    border-radius: 4px;
    pointer-events: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border: 2px dashed white;
    animation: pulse 2s infinite alternate;
}

/* Hervorhebung für den geklickten Block */
.ghost-drag-point {
    opacity: 0.8;
    border: 3px solid white;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
    animation: ghostPulse 1s infinite alternate;
    z-index: 5;
}

/* Animierte Hilfselemente */
.ghost-reference-arrow div {
    animation: arrowBounce 0.8s infinite alternate;
}

.ghost-reference-info {
    animation: fadeInOut 2s infinite alternate;
}

@keyframes ghostPulse {
    0% { transform: scale(0.95); opacity: 0.7; }
    100% { transform: scale(1.05); opacity: 0.9; }
}

@keyframes arrowBounce {
    0% { transform: translateY(-5px); }
    100% { transform: translateY(0px); }
}

@keyframes fadeInOut {
    0% { opacity: 0.7; }
    100% { opacity: 1; }
}

.block-queue {
    display: flex;
    justify-content: center;
    gap: 1rem;
    width: 100%;
    padding: 1rem;
    background-color: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.1);
    animation: slideInUp 0.5s ease-out;
}

.block-queue .block {
    width: 60px;
    height: 60px;
}

/* Tetromino styles */
.tetromino {
    cursor: pointer;
    padding: 8px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 4px;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
    display: inline-block;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    animation: popIn 0.5s ease-out;
    opacity: 0;
    transform: translateY(10px);
}

.tetromino:hover {
    transform: scale(1.05);
    background-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.tetromino.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.tetromino.disabled:hover {
    transform: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.shape-preview {
    min-width: 60px;
    min-height: 60px;
    display: grid;
    gap: 2px;
}

.shape-preview .block {
    width: 100%;
    height: 100%;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.game-info {
    display: flex;
    justify-content: space-between;
    width: 100%;
    font-size: 1.25rem;
    font-weight: bold;
    animation: fadeIn 0.5s ease-out;
}

/* Game Over Screen */
.game-over-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    z-index: 100;
    animation: fadeIn 0.5s ease-out;
}

.game-over-content {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    max-width: 80%;
    animation: scaleIn 0.5s ease-out;
}

.game-over-content h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #dc3545;
}

.game-over-content p {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.game-over-content button {
    font-size: 1.2rem;
    padding: 0.75rem 1.5rem;
}

/* Block styles */
.block {
    width: 100%;
    height: 100%;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.block:hover {
    transform: scale(1.05);
}

.block.red { background-color: #ff5252; }
.block.blue { background-color: #536dfe; }
.block.green { background-color: #4caf50; }
.block.yellow { background-color: #ffeb3b; }
.block.purple { background-color: #9c27b0; }
.block.orange { background-color: #ff9800; }

/* Login prompt */
.login-prompt {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 600px;
    width: 100%;
    animation: slideInUp 0.5s ease-out, pulse 2s infinite alternate;
}

.login-prompt p {
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 1rem 0;
    color: #fff;
    margin-top: 2rem;
    animation: fadeIn 1s ease-out;
}

/* Loading spinner */
.loading-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.loading-container.active {
    opacity: 1;
    visibility: visible;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid transparent;
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s ease-in-out infinite;
}

.spinner:before, .spinner:after {
    content: '';
    position: absolute;
    border: 5px solid transparent;
    border-radius: 50%;
}

.spinner:before {
    top: -15px;
    left: -15px;
    right: -15px;
    bottom: -15px;
    border-top-color: #667eea;
    animation: spin 2s ease-in-out infinite;
}

.spinner:after {
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    border-top-color: #764ba2;
    animation: spin 1.5s ease-in-out infinite reverse;
}

.loading-text {
    position: absolute;
    top: calc(50% + 50px);
    color: white;
    font-size: 16px;
    letter-spacing: 2px;
    animation: pulse 1.5s infinite;
}

/* Auth provider badge */
.auth-badge {
    display: inline-block;
    background-color: rgba(255, 255, 255, 0.2);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-top: 0.5rem;
    animation: fadeIn 1s ease-out;
}

/* Responsive design */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .user-info {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .game-board {
        gap: 2px;
    }
    
    .block-queue .block {
        width: 40px;
        height: 40px;
    }
}

/* Animation for block removal */
@keyframes fadeOut {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(1.2); }
}

.fadeOut {
    animation: fadeOut 0.5s forwards;
}

/* Animation for combo */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 0.5s infinite;
}

/* Additional animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes popIn {
    0% { opacity: 0; transform: scale(0.5); }
    70% { transform: scale(1.1); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

@keyframes floatAnimation {
    0% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0); }
}

/* Pulse animation for ghost blocks */
@keyframes pulse {
    0% { opacity: 0.5; }
    100% { opacity: 0.7; }
} 