/* Counter App Styles */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --info-color: #17a2b8;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --dark-color: #343a40;
    --light-color: #f8f9fa;
    --border-radius: 12px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: #333;
}

.container {
    width: 100%;
    max-width: 800px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Header */
header {
    background: linear-gradient(to right, var(--primary-color), #0056b3);
    color: white;
    padding: 25px 20px;
    text-align: center;
}

header h1 {
    font-size: 2.2rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.subtitle {
    font-size: 1rem;
    opacity: 0.9;
}

/* Main Content */
main {
    padding: 25px;
}

/* Counter Display */
.counter-display {
    background: var(--light-color);
    border-radius: var(--border-radius);
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid #dee2e6;
}

.current-count {
    text-align: center;
    margin-bottom: 25px;
}

.count-label {
    display: block;
    font-size: 1.2rem;
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.count-value {
    display: block;
    font-size: 4rem;
    font-weight: bold;
    color: var(--primary-color);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

/* Buttons */
.counter-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 140px;
}

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

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

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #0069d9;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #218838;
}

.btn-info {
    background-color: var(--info-color);
    color: white;
}

.btn-info:hover {
    background-color: #138496;
}

.btn-warning {
    background-color: var(--warning-color);
    color: #212529;
}

.btn-warning:hover {
    background-color: #e0a800;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

/* Advanced Controls */
.advanced-controls {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    border: 1px solid #dee2e6;
}

.input-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.input-group label {
    font-weight: 600;
    color: var(--dark-color);
}

.input-group input {
    padding: 10px 15px;
    border: 2px solid #ced4da;
    border-radius: 6px;
    font-size: 1rem;
    width: 100px;
    transition: var(--transition);
}

.input-group input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.action-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* History Section */
.history-section {
    background: white;
    border-radius: var(--border-radius);
    padding: 25px;
    border: 1px solid #dee2e6;
}

.history-section h2 {
    color: var(--dark-color);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.history-list {
    min-height: 100px;
    max-height: 300px;
    overflow-y: auto;
    padding: 15px;
    background: var(--light-color);
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #dee2e6;
}

.empty-history {
    color: var(--secondary-color);
    text-align: center;
    font-style: italic;
    padding: 20px;
}

.history-item {
    background: white;
    padding: 12px 15px;
    margin-bottom: 10px;
    border-radius: 6px;
    border-left: 4px solid var(--primary-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--box-shadow);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

.history-value {
    font-weight: bold;
    font-size: 1.2rem;
    color: var(--primary-color);
}

.history-timestamp {
    font-size: 0.85rem;
    color: var(--secondary-color);
}

/* Stats */
.history-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.stat {
    background: var(--light-color);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #dee2e6;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: var(--secondary-color);
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--dark-color);
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    background: var(--light-color);
    border-top: 1px solid #dee2e6;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 6px;
    transition: var(--transition);
}

.nav-link:hover {
    background-color: rgba(0, 123, 255, 0.1);
    text-decoration: none;
}

#copy {
    margin-top: 15px;
    color: var(--secondary-color);
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .counter-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .history-stats {
        grid-template-columns: 1fr;
    }
    
    header h1 {
        font-size: 1.8rem;
        flex-direction: column;
        gap: 5px;
    }
}

@media (max-width: 480px) {
    .container {
        border-radius: 8px;
    }
    
    main, .counter-display, .history-section {
        padding: 15px;
    }
    
    .count-value {
        font-size: 3rem;
    }
    
    .input-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .input-group input {
        width: 100%;
    }
}