/* tinyurl-clone - css/style.css
   Styles principaux pour l'interface utilisateur */

/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

/* Conteneur principal */
.container {
    max-width: 700px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* En-tête */
header {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.stats {
    font-size: 0.9rem;
    margin-top: 15px;
    opacity: 0.8;
}

/* Section principale */
main {
    padding: 40px 30px;
}

/* Messages de succès */
.success-box {
    background: #e8f5e9;
    border-left: 4px solid #4caf50;
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 4px;
}

.success-box h3 {
    color: #2e7d32;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.success-box p {
    margin-bottom: 15px;
}

/* Messages d'erreur */
.error-box {
    background: #ffebee;
    border-left: 4px solid #f44336;
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 4px;
}

.error-box h3 {
    color: #c62828;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.error-box p {
    color: #d32f2f;
    margin: 0;
}

/* Formulaire */
.url-form {
    margin-bottom: 40px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 1rem;
}

.url-form input[type="url"] {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.url-form input[type="url"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.url-form input[type="url"]::placeholder {
    color: #aaa;
}

/* Boutons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn.copied {
    background: #4caf50 !important;
}

/* Container de copie */
.copy-container {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.copy-container input[type="text"] {
    flex: 1;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    background: #f9f9f9;
}

/* Section d'information */
.info-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin-top: 40px;
}

.info-section h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.info-section ul {
    list-style: none;
    padding-left: 0;
}

.info-section ul li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.info-section ul li:last-child {
    border-bottom: none;
}

.info-section ul li a {
    color: #667eea;
    text-decoration: none;
    font-size: 0.9rem;
}

.info-section ul li a:hover {
    text-decoration: underline;
}

/* Page d'erreur */
.error-page {
    text-align: center;
    padding: 40px 20px;
}

.error-page h2 {
    color: #d32f2f;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.error-page p {
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.error-page strong {
    color: #c62828;
}

.error-actions {
    margin-top: 30px;
}

/* Page de détails */
.details-box {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 8px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #e0e0e0;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 600;
    color: #666;
}

.detail-value {
    font-family: 'Courier New', monospace;
    color: #333;
}

.detail-value.code {
    background: #f0f0f0;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 1.1rem;
}

.detail-value.stats {
    color: #667eea;
    font-weight: 700;
}

.detail-actions {
    margin-top: 30px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.detail-actions .btn {
    flex: 1;
    min-width: 150px;
}

/* Footer */
footer {
    background: #f8f9fa;
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 0.9rem;
}

footer p {
    margin: 0;
}

/* Feedback toast */
.feedback {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
    white-space: nowrap;
}

.feedback.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    header {
        padding: 30px 20px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    main {
        padding: 25px 20px;
    }
    
    .detail-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .detail-actions {
        flex-direction: column;
    }
    
    .detail-actions .btn {
        width: 100%;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.success-box, .error-box, .details-box {
    animation: fadeIn 0.3s ease-out;
}
