:root {
    --primary: #2a75bb; /* Star Wars blue */
    --secondary:#00d9ff; /* Star Wars gold */
    --dark: #121212;
    --light: #f8f8f8;
    --r2-blue: #3a75c4;
    --r2-silver: #d0d0d0;
    --imperial-red: #ed1caece;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--dark);
    color: var(--light);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background-image: url('https://images.unsplash.com/photo-1534796636912-3b95b3ab5986?q=80&w=1471&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.container {
    max-width: 800px;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--secondary);
}

h1 {
    text-align: center;
    margin-bottom: 10px;
    color: var(--secondary);
    font-size: 2.5rem;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.subtitle {
    text-align: center;
    margin-bottom: 30px;
    color: var(--light);
    font-style: italic;
}

.translator-box {
    margin-top: 20px;
}

.mode-selector {
    display: flex;
    margin-bottom: 20px;
    border-radius: 5px;
    overflow: hidden;
}

.mode-selector button {
    flex: 1;
    padding: 10px;
    border: none;
    background-color: #333;
    color: var(--light);
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.mode-selector button.active {
    background-color: var(--primary);
    color: white;
}

.mode-selector button:first-child {
    border-right: 1px solid var(--dark);
}

.input-area, .output-area {
    margin-bottom: 20px;
}

textarea {
    width: 100%;
    padding: 15px;
    border-radius: 5px;
    border: 2px solid #444;
    background-color: #222;
    color: var(--light);
    font-size: 1rem;
    resize: vertical;
    min-height: 100px;
}

textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.translate-button {
    width: 100%;
    padding: 12px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    margin-bottom: 20px;
    transition: all 0.3s;
}

.translate-button:hover {
    background-color: #1a5b9b;
    transform: translateY(-2px);
}

.actions {
    display: flex;
    gap: 10px;
}

.action-button {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 5px;
    background-color: #444;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
}

.action-button:hover {
    background-color: #555;
}

.action-button i {
    margin-right: 5px;
}

.morse-reference {
    margin-top: 30px;
    padding: 15px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    border: 1px solid var(--secondary);
}

.morse-reference h3 {
    color: var(--secondary);
    margin-bottom: 10px;
    text-align: center;
}

#morseChart {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

.morse-item {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 8px;
    border-radius: 5px;
    text-align: center;
}

.morse-char {
    font-weight: bold;
    color: var(--secondary);
}

.morse-code {
    font-family: monospace;
}

/* R2-D2 Animation */
.droid-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.r2d2 {
    width: 80px;
    height: 120px;
    position: relative;
    animation: float 3s ease-in-out infinite;
}

.head {
    width: 60px;
    height: 30px;
    background-color: var(--r2-silver);
    border-radius: 10px 10px 0 0;
    position: relative;
    margin: 0 auto;
}

.eye {
    width: 10px;
    height: 10px;
    background-color: var(--imperial-red);
    border-radius: 50%;
    position: absolute;
    top: 10px;
    animation: blink 5s infinite;
}

.eye:nth-child(1) {
    left: 10px;
}

.eye:nth-child(2) {
    right: 10px;
}

.body {
    width: 80px;
    height: 60px;
    background-color: var(--r2-blue);
    border-radius: 10px;
    position: relative;
}

.panel {
    width: 60px;
    height: 40px;
    background-color: var(--r2-silver);
    border-radius: 5px;
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.legs {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 5px;
}

.leg {
    width: 15px;
    height: 20px;
    background-color: var(--r2-silver);
    border-radius: 0 0 5px 5px;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes blink {
    0%, 48%, 52%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Responsive design */
@media (max-width: 600px) {
    .container {
        padding: 15px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .actions {
        flex-direction: column;
    }
}