/**
 * Animace pro Copy&Paste aplikaci
 */

/* Fade In animace */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Pulse animace pro tlačítka */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Slide In animace pro karty */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Bounce animace pro notifikace */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

/* Rotate animace pro ikony */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Shake animace pro chybové zprávy */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

/* Glow animace pro zvýraznění */
@keyframes glow {
    0% {
        box-shadow: 0 0 5px rgba(254, 230, 0, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(254, 230, 0, 0.8);
    }
    100% {
        box-shadow: 0 0 5px rgba(254, 230, 0, 0.5);
    }
}

/* Třídy pro aplikaci animací */
.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

.pulse {
    animation: pulse 1s infinite;
}

.slide-in {
    animation: slideIn 0.5s ease-out forwards;
}

.bounce {
    animation: bounce 1s;
}

.rotate {
    animation: rotate 1s linear infinite;
}

.shake {
    animation: shake 0.5s;
}

.glow {
    animation: glow 2s infinite;
}

/* Animace pro jednotlivé prvky */
.login-container {
    animation: fadeIn 0.8s ease-out forwards;
}

.app-title {
    position: relative;
    animation: fadeIn 0.5s ease-out forwards;
}

.app-title::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 3px;
    background-color: var(--text-color);
    animation: expandWidth 1s ease-out forwards 0.5s;
}

@keyframes expandWidth {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

.editor-card {
    animation: fadeIn 0.6s ease-out forwards;
}

.text-item {
    animation: slideIn 0.5s ease-out forwards;
    animation-fill-mode: both;
}

/* Postupné načítání položek */
.text-item:nth-child(1) { animation-delay: 0.1s; }
.text-item:nth-child(2) { animation-delay: 0.2s; }
.text-item:nth-child(3) { animation-delay: 0.3s; }
.text-item:nth-child(4) { animation-delay: 0.4s; }
.text-item:nth-child(5) { animation-delay: 0.5s; }
.text-item:nth-child(6) { animation-delay: 0.6s; }
.text-item:nth-child(7) { animation-delay: 0.7s; }
.text-item:nth-child(8) { animation-delay: 0.8s; }
.text-item:nth-child(9) { animation-delay: 0.9s; }
.text-item:nth-child(10) { animation-delay: 1.0s; }

/* Animace pro tlačítka */
.btn-primary {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.btn-primary:hover::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    20% {
        transform: scale(25, 25);
        opacity: 0.3;
    }
    100% {
        opacity: 0;
        transform: scale(40, 40);
    }
}

/* Animace pro notifikace (flash messages) */
.notification {
    padding: 15px 20px;
    margin-bottom: 10px;
    background-color: white;
    color: var(--text-color);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    transform: translateY(-20px);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    min-width: 300px;
    max-width: 500px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.notification::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 5px;
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
}

.notification.hide {
    transform: translateY(-20px);
    opacity: 0;
}

.notification-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    border: none;
    color: #999;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.notification-close:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: #666;
}

.notification-icon {
    margin-right: 15px;
    font-size: 1.5rem;
}

.notification-content {
    flex: 1;
}

.notification-success::before {
    background-color: #28a745;
}

.notification-success .notification-icon {
    color: #28a745;
}

.notification-error::before {
    background-color: #dc3545;
}

.notification-error .notification-icon {
    color: #dc3545;
}

.notification-warning::before {
    background-color: #ffc107;
}

.notification-warning .notification-icon {
    color: #ffc107;
}

.notification-info::before {
    background-color: #17a2b8;
}

.notification-info .notification-icon {
    color: #17a2b8;
}

/* Animace pro loading spinner */
.loading-spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: rotate 1s linear infinite;
}

/* Animace pro přechod stránek */
.page-transition {
    animation: fadeIn 0.5s ease-out forwards;
}

/* Animace pro hover efekty */
.text-item {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.text-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

/* Animace pro přihlašovací formulář */
.login-form .form-group {
    opacity: 0;
    animation: fadeIn 0.5s ease-out forwards;
}

.login-form .form-group:nth-child(1) {
    animation-delay: 0.2s;
}

.login-form .form-group:nth-child(2) {
    animation-delay: 0.4s;
}

.login-form button {
    opacity: 0;
    animation: fadeIn 0.5s ease-out forwards 0.6s;
}

/* Animace pro chybové zprávy */
.error-message {
    animation: shake 0.5s;
}
