* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 30px;
    max-width: 800px;
    width: 100%;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.logo-icon {
    font-size: 2em;
    animation: pulse 2s infinite;
}

.logo-text {
    font-size: 2em;
    font-weight: 700;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tagline {
    color: #6b7280;
    font-size: 0.95em;
}

/* Main Content */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* Input Section */
.input-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
    border: 1px solid #e9ecef;
}

.input-section label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 10px;
}

.label-icon {
    font-size: 1.2em;
}

.textarea-wrapper {
    position: relative;
    display: flex;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s;
}

.textarea-wrapper:focus-within {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.line-numbers {
    background: #f3f4f6;
    color: #9ca3af;
    padding: 12px 8px;
    text-align: right;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    user-select: none;
    min-width: 30px;
    overflow-y: hidden;
    white-space: pre-line;
}

textarea {
    flex: 1;
    padding: 12px;
    border: none;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
    background: transparent;
}

textarea:focus {
    outline: none;
}

/* Buttons */
.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.btn-generate, .btn-clear, .btn-copy-all {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-generate {
    background: #667eea;
    color: white;
    flex: 1;
}

.btn-generate:hover {
    background: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-clear {
    background: #ef4444;
    color: white;
}

.btn-clear:hover {
    background: #dc2626;
}

.btn-copy-all {
    background: #10b981;
    color: white;
}

.btn-copy-all:hover {
    background: #059669;
}

/* Codes Display */
.codes-display {
    background: #fafafa;
    border-radius: 15px;
    padding: 20px;
    border: 1px solid #e5e7eb;
}

.codes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.codes-header h3 {
    color: #1f2937;
    font-size: 1.1em;
}

.timer {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #6b7280;
    font-size: 0.9em;
}

.timer-icon {
    animation: rotate 30s linear infinite;
}

/* Codes List */
.codes-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.code-item {
    background: white;
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
    gap: 15px;
}

.code-item:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.line-number {
    background: #f3f4f6;
    color: #6b7280;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    min-width: 30px;
    text-align: center;
}

.code-info {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
}

.code-secret {
    font-family: 'Courier New', monospace;
    font-size: 0.8em;
    color: #6b7280;
    min-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.code-value {
    font-family: 'Courier New', monospace;
    font-size: 1.3em;
    font-weight: 700;
    color: #667eea;
    letter-spacing: 2px;
}

/* Horizontal Layout */
body.horizontal-layout .container {
    max-width: 1400px;
}

body.horizontal-layout .main-content {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 25px;
}

body.horizontal-layout .codes-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 10px;
}

body.horizontal-layout .code-item {
    min-width: 0;
}

body.horizontal-layout .code-secret {
    min-width: auto;
    max-width: 180px;
}

.copy-single {
    padding: 8px 16px;
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s;
}

.copy-single:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.copy-single.copied {
    background: #10b981;
    color: white;
    border-color: #10b981;
}

/* Empty State */
.empty-message {
    text-align: center;
    padding: 40px;
    color: #9ca3af;
}

.empty-icon {
    font-size: 3em;
    display: block;
    margin-bottom: 10px;
}

/* Settings Section */
.settings-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.toggle-group {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.toggle-slider {
    width: 44px;
    height: 24px;
    background: #e5e7eb;
    border-radius: 24px;
    position: relative;
    transition: background 0.3s;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: transform 0.3s;
}

input[type="checkbox"]:checked + .toggle-slider {
    background: #667eea;
}

input[type="checkbox"]:checked + .toggle-slider::after {
    transform: translateX(20px);
}

input[type="checkbox"] {
    display: none;
}

.toggle-text {
    color: #6b7280;
    font-size: 0.9em;
}

/* Animations */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes slideIn {
    from { 
        transform: translateY(-20px);
        opacity: 0;
    }
    to { 
        transform: translateY(0);
        opacity: 1;
    }
}

.pulse {
    animation: pulse 0.5s ease-in-out;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    
    .logo-text {
        font-size: 1.5em;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons button {
        width: 100%;
    }
    
    .code-secret {
        min-width: auto;
        font-size: 0.75em;
    }
    
    body.horizontal-layout .main-content {
        grid-template-columns: 1fr;
    }
    
    body.horizontal-layout .codes-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .code-info {
        gap: 10px;
    }
    
    .code-value {
        font-size: 1.1em;
    }
    
    .copy-single {
        padding: 6px 12px;
        font-size: 0.8em;
    }
    
    .line-numbers {
        padding: 12px 4px;
        min-width: 25px;
        font-size: 12px;
    }
    
    .line-number {
        padding: 2px 6px;
        font-size: 0.8em;
    }
} 