:root {
    --primary-color: #4A90E2;
    --secondary-color: #50E3C2;
    --background-color: #000000;
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-color: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --success-color: #50E3C2;
    --warning-color: #FFB800;
    --danger-color: #FF6B6B;
    --gradient: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--background-color);
    color: var(--text-color);
    min-height: 100vh;
    padding: 2rem 1rem;
    line-height: 1.6;
}

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

.header {
    text-align: center;
    margin-bottom: 3rem;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header h1 i {
    margin-right: 0.5rem;
    -webkit-text-fill-color: var(--primary-color);
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(74, 144, 226, 0.1);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card h2 i {
    color: var(--primary-color);
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-field-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.field-label {
    color: var(--text-color);
    font-size: 0.95rem;
    font-weight: 600;
}

.radio-group {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--text-color);
    font-size: 0.95rem;
    user-select: none;
}

.radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.radio-label span {
    transition: color 0.3s ease;
}

.radio-label:hover span {
    color: var(--primary-color);
}

.subnet-wrapper {
    display: flex;
    align-items: center;
    gap: 0;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.subnet-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.subnet-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 1rem;
    padding: 0.75rem;
    outline: none;
    font-family: 'Courier New', monospace;
}

.subnet-select {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.75rem;
    color: var(--text-color);
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    min-width: 180px;
}

.subnet-select:hover {
    background: rgba(255, 255, 255, 0.08);
}

.subnet-select:focus {
    background: rgba(255, 255, 255, 0.08);
}

.subnet-select option {
    background: var(--background-color);
    color: var(--text-color);
}

.ip-input-field {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.75rem;
    color: var(--text-color);
    font-size: 1rem;
    font-family: 'Courier New', monospace;
    transition: all 0.3s ease;
    outline: none;
}

.ip-input-field::placeholder {
    color: var(--text-secondary);
}

.ip-input-field:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.button-group {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.btn-calculate {
    background: var(--gradient);
    color: var(--text-color);
    border: none;
    padding: 0.875rem 1.75rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    white-space: nowrap;
    flex: 1;
    justify-content: center;
}

.btn-calculate:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(74, 144, 226, 0.3);
}

.btn-calculate:active:not(:disabled) {
    transform: translateY(0);
}

.btn-calculate:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-calculate i {
    font-size: 0.85rem;
}

.btn-clear {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.875rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-clear:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-clear:active {
    transform: translateY(1px);
}

.error-message {
    color: var(--danger-color);
    margin-top: 1rem;
    padding: 0.75rem;
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.3);
    border-radius: 8px;
    display: none;
}

.error-message.show {
    display: block;
}

.info-note {
    margin-top: 1rem;
    padding: 0.75rem;
    background: rgba(74, 144, 226, 0.1);
    border: 1px solid rgba(74, 144, 226, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.info-note i {
    color: var(--primary-color);
    margin-top: 0.1rem;
    flex-shrink: 0;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.info-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.25rem;
    transition: all 0.3s ease;
}

.info-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.info-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-label i {
    color: var(--primary-color);
    font-size: 0.9rem;
}

.info-value-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: space-between;
}

.info-value {
    color: var(--text-color);
    font-size: 1.1rem;
    font-weight: 600;
    word-break: break-word;
    font-family: 'Courier New', monospace;
    flex: 1;
}

.info-value.empty {
    color: var(--text-secondary);
    font-style: italic;
}

.copy-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-width: 36px;
    height: 36px;
}

.copy-btn:hover {
    background: rgba(74, 144, 226, 0.2);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
}

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

.copy-btn i {
    font-size: 0.9rem;
}

.binary-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.binary-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.25rem;
}

.binary-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.binary-label i {
    color: var(--primary-color);
    font-size: 0.9rem;
}

.binary-value-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    justify-content: space-between;
}

.binary-value {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.8;
    color: var(--text-color);
    word-break: break-all;
    flex: 1;
}

.binary-octet {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    margin: 0.1rem;
    border-radius: 4px;
    background: rgba(74, 144, 226, 0.1);
    border: 1px solid rgba(74, 144, 226, 0.2);
}

.binary-octet.network {
    background: rgba(80, 227, 194, 0.1);
    border-color: rgba(80, 227, 194, 0.2);
}

.binary-octet.host {
    background: rgba(255, 184, 0, 0.1);
    border-color: rgba(255, 184, 0, 0.2);
}

.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    display: none;
    align-items: center;
    gap: 0.75rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

.toast.show {
    display: flex;
}

.toast i {
    color: var(--success-color);
    font-size: 1.2rem;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 1rem 0.5rem;
    }

    .header h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .card {
        padding: 1.5rem;
    }

    .radio-group {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .button-group {
        flex-direction: column;
    }

    .btn-calculate,
    .btn-clear {
        width: 100%;
    }

    .info-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .binary-value {
        font-size: 0.8rem;
    }

    .toast {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.75rem;
    }

    .card {
        padding: 1.25rem;
    }

    .card h2 {
        font-size: 1.25rem;
    }

    .info-value {
        font-size: 1rem;
    }

    .binary-value {
        font-size: 0.75rem;
    }
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 3rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.app-footer p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0;
}

.app-footer a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.app-footer a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

.app-footer .footer-link {
    color: var(--secondary-color);
}

.app-footer .footer-link:hover {
    color: var(--primary-color);
}

.app-footer .bmc-logo {
    display: inline-block;
    margin-top: 1rem;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.app-footer .bmc-logo:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

.app-footer .bmc-logo img {
    height: 60px;
    width: 217px;
}

.app-footer .view-all-apps-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 1rem auto 0 auto;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    width: fit-content;
}

.app-footer .view-all-apps-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 242, 255, 0.3);
    text-decoration: none;
}

