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

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

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

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

.main-content {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.connection-panel, .message-panel, .file-panel {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}

.connection-panel h2, .message-panel h2, .file-panel h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.3rem;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.status-display {
    margin-bottom: 20px;
}

.status {
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 1rem;
    display: inline-block;
}

.status.disconnected {
    background: #ffebee;
    color: #c62828;
}

.status.connecting {
    background: #fff3e0;
    color: #ef6c00;
}

.status.connected {
    background: #e8f5e9;
    color: #2e7d32;
}

.connection-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.connection-actions button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

#generateOffer {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

#generateOffer:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(17, 153, 142, 0.4);
}

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

#acceptInvite:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.invite-code, .enter-code {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

.invite-code span {
    font-weight: 600;
    color: #555;
}

.invite-code input, .enter-code input {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-family: monospace;
    font-size: 0.9rem;
    background: #f5f5f5;
}

.invite-code button, .enter-code button {
    padding: 10px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.invite-code button {
    background: #f0f0f0;
    color: #333;
}

.invite-code button:hover {
    background: #e0e0e0;
}

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

.enter-code button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.messages-container {
    height: 300px;
    overflow-y: auto;
    border: 2px solid #eee;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    background: #fafafa;
}

.message {
    margin-bottom: 12px;
    padding: 10px 15px;
    border-radius: 12px;
    max-width: 80%;
    word-wrap: break-word;
}

.message.sent {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-left: auto;
}

.message.received {
    background: #e0e0e0;
    color: #333;
    margin-right: auto;
}

.message .time {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 4px;
}

.message-input {
    display: flex;
    gap: 10px;
}

.message-input input {
    flex: 1;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.message-input input:focus {
    outline: none;
    border-color: #667eea;
}

.message-input button, .file-input button {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.message-input button:hover:not(:disabled), .file-input button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.message-input button:disabled, .file-input button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.file-input {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.file-input input {
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
}

.file-list {
    border: 2px solid #eee;
    border-radius: 8px;
    padding: 15px;
    background: #fafafa;
    min-height: 150px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    background: white;
    border-radius: 8px;
    margin-bottom: 10px;
    border: 1px solid #eee;
}

.file-item:last-child {
    margin-bottom: 0;
}

.file-info {
    flex: 1;
}

.file-name {
    font-weight: 600;
    color: #333;
}

.file-size {
    font-size: 0.85rem;
    color: #666;
    margin-top: 4px;
}

.file-progress {
    width: 100%;
    height: 6px;
    background: #eee;
    border-radius: 3px;
    margin-top: 8px;
    overflow: hidden;
}

.file-progress-bar {
    height: 100%;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    width: 0%;
    transition: width 0.3s;
}

.file-actions {
    display: flex;
    gap: 8px;
}

.btn-download {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    background: #4caf50;
    color: white;
}

.btn-download:hover {
    background: #43a047;
}

@media (max-width: 900px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}