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

:root {
    --primary: #000000;
    --secondary: #ffffff;
    --success: #4CAF50;
    --danger: #f44336;
    --dark: #0a0a0a;
    --light: #ffffff;
    --gray: #888888;
    --bg-dark: #0f0f0f;
    --bg-darker: #050505;
    --border: #333333;
}

html, body {
    width: 100%;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Helvetica Neue', sans-serif;
    background: var(--dark);
    color: var(--light);
    overflow-x: hidden;
}

body {
    position: relative;
}

.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(255,255,255,0.02) 2px, rgba(255,255,255,0.02) 4px),
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(255,255,255,0.02) 2px, rgba(255,255,255,0.02) 4px);
    pointer-events: none;
    z-index: 0;
}

@keyframes bgPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

main {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
    animation: fadeInDown 0.6s ease-out;
    padding: 30px;
    background: var(--bg-dark);
    border-radius: 16px;
    border: 2px solid var(--border);
}

.header h1 {
    font-size: 2.8rem;
    font-weight: 900;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
    margin-bottom: 5px;
    letter-spacing: -3px;
    text-transform: uppercase;
    font-family: 'Arial Black', sans-serif;
}

.version {
    font-size: 0.4em;
    opacity: 0.6;
    background: var(--light);
    color: var(--dark);
    padding: 4px 12px;
    border-radius: 8px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Stats Dashboard */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.stat-card {
    background: var(--bg-darker);
    border-radius: 2px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
    border: 2px solid var(--border);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--light);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.1);
    border-color: var(--light);
}

.stat-card i {
    font-size: 2rem;
    opacity: 0.8;
}

.stat-card.success i {
    color: #4ade80;
}

.stat-card.rate i {
    color: #60a5fa;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.85rem;
    opacity: 0.8;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
}

/* Control Panel */
.control-panel {
    background: var(--bg-dark);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 20px;
    border: 2px solid var(--border);
    animation: fadeInUp 0.6s ease-out 0.4s both;
}

.input-group {
    margin-bottom: 25px;
}

.input-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 0.95rem;
}

.input-group label i {
    margin-right: 8px;
    opacity: 0.8;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-darker);
    border-radius: 2px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 2px solid var(--border);
}

.input-wrapper:focus-within {
    border-color: var(--light);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

.input-prefix {
    padding: 0 15px;
    background: var(--border);
    color: var(--light);
    font-weight: 700;
    font-size: 1.1rem;
}

input[type="text"],
input[type="number"],
textarea {
    width: 100%;
    padding: 15px;
    border: none;
    outline: none;
    font-size: 1rem;
    font-family: inherit;
    color: var(--light);
    background: transparent;
}

input[type="number"] {
    background: var(--bg-darker);
    border-radius: 2px;
    border: 2px solid var(--border);
}

input[type="number"]:focus {
    border-color: var(--light);
}

textarea {
    background: var(--bg-darker);
    border-radius: 2px;
    resize: vertical;
    min-height: 100px;
    border: 2px solid var(--border);
}

textarea:focus {
    border-color: var(--light);
}

.message-wrapper {
    position: relative;
}

.dice-btn {
    position: absolute;
    right: 10px;
    bottom: 10px;
    width: 40px;
    height: 40px;
    border-radius: 2px;
    background: var(--light);
    border: 2px solid var(--light);
    color: var(--dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    font-weight: 900;
}

.dice-btn:hover {
    background: var(--dark);
    color: var(--light);
    transform: rotate(180deg);
}

.char-counter {
    margin-top: 8px;
    text-align: right;
    font-size: 0.85rem;
    opacity: 0.7;
}

/* Mode Selector */
.mode-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.mode-btn {
    padding: 12px 20px;
    background: var(--bg-darker);
    border: 2px solid var(--border);
    border-radius: 2px;
    color: var(--light);
    cursor: pointer;
    font-weight: 700;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.85rem;
}

.mode-btn:hover {
    background: var(--border);
    border-color: var(--light);
}

.mode-btn.active {
    background: var(--light);
    border-color: var(--light);
    color: var(--dark);
}

.hidden {
    display: none !important;
}

/* Settings Section */
.settings-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.settings-toggle {
    width: 100%;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: white;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
}

.settings-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
}

.settings-content {
    margin-top: 15px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
}

.setting-row {
    margin-bottom: 15px;
}

.setting-row:last-child {
    margin-bottom: 0;
}

.setting-row label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.help-text {
    display: block;
    margin-top: 5px;
    font-size: 0.8rem;
    opacity: 0.7;
}

.checkbox-row label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-row input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.bulk-info {
    margin-top: 8px;
    text-align: right;
    font-size: 0.85rem;
    opacity: 0.7;
    font-weight: 600;
}

/* Status Container */
.status-container {
    margin: 20px 0;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    border-left: 4px solid var(--success);
}

.status-indicator i {
    font-size: 0.8rem;
    animation: pulse 2s ease-in-out infinite;
}

.status-indicator.active {
    border-left-color: var(--success);
    background: rgba(11, 156, 49, 0.2);
}

.status-indicator.active i {
    color: var(--success);
}

.status-indicator.error {
    border-left-color: var(--danger);
    background: rgba(220, 53, 69, 0.2);
}

.status-indicator.error i {
    color: var(--danger);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Buttons */
.button-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.control-btn {
    padding: 18px 30px;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.start-btn {
    background: var(--light);
    color: var(--dark);
    border: 2px solid var(--light);
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 40px rgba(255, 255, 255, 0.4);
    background: var(--dark);
    color: var(--light);
}

.pause-btn {
    background: var(--bg-darker);
    color: var(--light);
    border: 2px solid var(--gray);
}

.pause-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 40px rgba(136, 136, 136, 0.3);
    border-color: var(--light);
}

.stop-btn {
    background: var(--bg-darker);
    color: var(--danger);
    border: 2px solid var(--danger);
}

.stop-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 40px rgba(244, 67, 54, 0.3);
    background: var(--danger);
    color: var(--light);
}

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Progress Bar */
.progress-container {
    margin-bottom: 20px;
    animation: fadeInUp 0.6s ease-out;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #1a1a1a;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
    border: 2px solid #333;
}

.progress-fill {
    height: 100%;
    background: #ffffff;
    transition: width 0.3s ease;
    width: 0%;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}

.progress-text {
    text-align: center;
    font-size: 0.9rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Activity Log */
.activity-section {
    background: var(--bg-dark);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    border: 2px solid var(--border);
    animation: fadeInUp 0.6s ease-out 0.6s both;
}

.activity-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.activity-header h3 {
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.clear-btn {
    padding: 8px 16px;
    background: rgba(220, 53, 69, 0.2);
    border: 1px solid rgba(220, 53, 69, 0.4);
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.clear-btn:hover {
    background: rgba(220, 53, 69, 0.3);
}

.activity-log {
    max-height: 300px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 15px;
}

.log-placeholder {
    text-align: center;
    padding: 40px 20px;
    opacity: 0.6;
}

.log-placeholder i {
    font-size: 2rem;
    margin-bottom: 10px;
    display: block;
}

.log-entry {
    padding: 10px;
    margin-bottom: 8px;
    background: #0a0a0a;
    border-radius: 8px;
    border-left: 3px solid var(--success);
    font-size: 0.9rem;
    animation: slideInRight 0.3s ease-out;
    border: 1px solid #333;
}

.log-entry.error {
    border-left-color: var(--danger);
    border-left-width: 3px;
}

.log-entry.success {
    border-left-color: #ffffff;
    border-left-width: 3px;
}

.log-entry .timestamp {
    opacity: 0.6;
    font-size: 0.8rem;
    margin-right: 10px;
    color: #888;
}

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

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    opacity: 0.8;
    animation: fadeIn 0.6s ease-out 0.8s both;
}

.disclaimer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 0.95rem;
    background: var(--bg-darker);
    padding: 12px 20px;
    border-radius: 12px;
    border: 2px solid var(--border);
}

.disclaimer i {
    color: var(--light);
}

.credits {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.credits a {
    color: var(--light);
    text-decoration: none;
    font-weight: 900;
    border-bottom: 2px solid var(--light);
    transition: all 0.3s ease;
    padding-bottom: 2px;
}

.credits a:hover {
    border-bottom-color: transparent;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

/* Scrollbar */
.activity-log::-webkit-scrollbar {
    width: 8px;
}

.activity-log::-webkit-scrollbar-track {
    background: #0a0a0a;
    border-radius: 4px;
    border-left: 1px solid #333;
}

.activity-log::-webkit-scrollbar-thumb {
    background: #ffffff;
    border-radius: 4px;
    border: 1px solid #0a0a0a;
}

.activity-log::-webkit-scrollbar-thumb:hover {
    background: #cccccc;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsive Design */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }

    .control-panel {
        padding: 20px;
    }

    .mode-selector {
        grid-template-columns: 1fr;
    }

    .stats-container {
        grid-template-columns: 1fr;
    }

    .button-group {
        grid-template-columns: 1fr;
    }
}
